here is my code --> https://ide.codingblocks.com/s/452831
Sir, where am i doing mistake?
hello @chandreshmaurya
a) use long long in place of int
b) u r asked to take mod of answer but u r not taking.
c) array is not sorted so u need to find max first .
d) painter used must initilaise with 1
sir, i did as your guidance. But, after that i failed in 2 test cases out of 6 test cases.
pls share ur updated code with me
Sir, i have one doubt. why are we sorting the array?
…
no we are not sorting . here order of array element matters so we cant sort it
check now->
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.