Not passing some test case

Even though i applied mod still getting wrong ans in same problem(painter partitions problem of Interview bit)

Solution : https://ide.codingblocks.com/s/294186

Qn : https://www.interviewbit.com/problems/painters-partition-problem/

Not passing test case :
A = 10
B = 1
C = [1, 8, 11, 3]

@Sus
so there are several problem areas in the code
s should not start with 0
instead it should be the max value of the array
use the time factor ie b at the end when u calculate the answer
i am sharing the code
please check this

https://ide.codingblocks.com/s/221156

dont just copy paste this is hackerblock version of the same q
input format is different

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.