Letter Case Permutation LeetCode solution in Python

1
class Solution(object):
2
def letterCasePermutation(self, s):
3

4
if s == "":
5
return [""]
6
t = s[0].lower()
7
li = []
8
res = self.letterCasePermutation(s[1:])
9
for i in res:
10
li.append(t + i)
11
if t not in "1234567890":
12
for i in res:
13
li.append(t.upper() + i)
14
return li

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0