Got an issue where I don't know how to fix it, the code works on another site.
s = "leeetcode"
def fun(s):
result = ""
i = 0
while i < len(s):
if i + 2 < len(s) and s[i] == s[i+1] == s[i+2]:
result += s[i] * 2 # Only keep two of them
i += 3 # Skip all three (we already took two)
else:
result += s[i]
i += 1
print(result)
fun(s)
NameError: name 'Solution' is not defined
^^^^^^^^
ret = Solution().makeFancyString(param_1)
Line 41 in _driver (Solution.py)
_driver()
Line 56 in <module> (Solution.py)