Facing error when running code

Im facing this error,

im facing this error shown in the picture even when i use the already accepted solution, that is submitted by others. even when i take help from AI available in the tab, it has failed to help my situation.
please help me with this.
I have provided the link to the problem Im trying to solve.

PS, the sample input, output provided are confusing in the above problem.