my solution is CodeChef: Practical coding for everyone
Refer to the Solution in Python3.
Thanks for Reading Peace
You’re failing the same testcase as this guy.