Solution is bit lengthy and my test case are still wrong

solution is bit lengthy and my test case are still wrong

Pls share your code by saving on ide so that I could check it…

check my code only one test case is write