NOKIA , Need help with my solution

The problem is : NOKIA

This is my solution : NOKIA 57701446

In solution, i created two recursive function, to find min an max possible value of length, that can be used. then i compared it with the value of m -(given value of wire length).

I tested it against all the possible cases, but i couldn’t figure it out. I am getting WA, but on checking with cases, I get correct value. I even checked it by checking the max and min value, which was correct.

Please tell me what am I missing, or a test case which my solution is missing?

Thank you!!