https://ide.codingblocks.com/s/216218 Please check the code only testcase 4 and 5 are passing
All testcases are not passing
@kt62495
hello Karan,
a)dont sort ur array becuase in question it is mentioned that painter can only paint continuous blocks.
b) use long long datatype.
c) ur s should start from maximum value in array .