class Solution: def decode(self,s): res, n = "", "" for char in s: if char.isdigit(): n += char elif n == "": res += char else: res += char * int(n) n = "" return res ob = Solution() print(ob.decode("A4B3C2"))
last
result
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)