Hi,
Please post correct link to the code. The link you have shared is of the submit page of the problem.
Your solution doesn’t even work for the sample test cases. Maybe you should try fixing for the sample cases by yourself and then if it still doesn’t work, you can ask here.