There's something wrong with my bool function. please rectify

my code https://ide.codingblocks.com/s/219460

kaffi errors h
u dont have to sort the array
since painter can paint contigous segments only
so the s would not be arr[n-1] but the max element


check out this code

why this : ans=((ans%10000003)*t)%10000003 ?
ref line 42

ignore the t factor
like there are 2 similar problem one where time is given for per unit paint

i am telling u to refer to the approach

I didn’t get as to why you did this.
what is this number : 10000003 ?
how did you arrive here?

refer this code
this should work perfectly fine

1 Like

My understanding of the problem was wrong.
Now I got your point. Thanks again :slight_smile:

1 Like