The painters partition

question link;-https://hack.codingblocks.com/contests/c/133/716
my solution :-https://ide.codingblocks.com/s/33895
I am getting 3 correct while 3 wrong on hacker blocks.

try tallying

1 Like

I was sorting the array earlier.
But i dont think it should change the answer anyways.
Can u plz tell how sorting the array makes difference ?

ok ordering matters as painters can only choose the continuous section of boards.
All right thanks.
Done
Sir Plz check my earlier doubt

1 Like