It would be great help if anyone could help . Thanks in advance
I checked your solution and it will give wrong output for case 2 8 and 2 11 and maybe many other.
your solution is in python so don’t getting much of it.
i have correct java solution link you can check it.In any part if you struck you can ask me here and i will try to clear doubt.