Code working in IDE but not in LeetCode

Hello,

I am solving a simple problem, and my solution is not well recognized on Leetcode. It works perfectly by initiating my variable manually in Pycharm.

I just want to reverse a list of characters for exemple from ["h","e","l","l","o"] to ["o","l","l","e","h"]

here is my code:

'''
class Solution(object):
def reverseString(self, s):
"""
:type s: List[str]
:rtype: None Do not return anything, modify s in-place instead.
"""
for i in range(len(s)-1):
s= s[:i] + s[len(s)-1:] + s[i:len(s)-1]
'''

Leetcode does not recognize any change. It tells me my answer is the same than the input.

Moreover if I print "s" in the first line (before midifying it) for debug it diplays a different list than the announced input.

image

Finally if I define manually the list, I can see by printing that my result is correct but not recognized by LeetCode...

image

Please help me it is driving me crazy...

Thanks in adavance,

Comments (5)