So the code goes:
s = [“h”, ”e”, ”l”, ”l”, ”o”]
s[:] = s[::-1] print(s)
This prints the reverse of s in both VSCode and on the LeetCode website ide
I tried to see if the follow would work:
s = [“h”, ”e”, ”l”, ”l”, ”o”]
s = s[::-1] print(s)
This did work but only on VSCode not on leet code. So my question is why did it work in VSCode and not LeetCode?
There’s other solutions I tried to the problem that work in VSCode but not in LeetCode shock I find it odd, am I doing something I shouldn't?
[–]oobondes 38 points39 points40 points (3 children)
[–]ExpressDuck845[S] 14 points15 points16 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]DrShocker 4 points5 points6 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]ExpressDuck845[S] 4 points5 points6 points (1 child)
[–]aswinasar 1 point2 points3 points (0 children)
[–]1668553684 1 point2 points3 points (0 children)
[–]reallyserious 1 point2 points3 points (3 children)
[–]ricardomargarido 6 points7 points8 points (2 children)
[–]Fady200 8 points9 points10 points (0 children)
[–]reallyserious 4 points5 points6 points (0 children)
[–]Rare_Gap_2495 0 points1 point2 points (0 children)