Winning cb scholarship

whats wrong in my code?

Hello @sktg99,

Your code i is logically correct.
But, there is a compile-time error:

error: no matching function for call to ‘max(long long int&, int&)’
ans = max(mid,ans);

Reason:
the max function compares for the variables of the same datatype.

Solution:
ll ans = 0;

Hope, this would help.
Give a like, if you are satisfied.