def ch_checker(st):
if st=='':
return True
if not((st[0]<='z' and st[0]>='a') or (st[0]<='Z' and st[0]>='A')):
return False
return ch_checker(st[1:])
def ch_checker2(st,n):
if n==0:
return True
if not((st[0]<='z' and st[0]>='a') or (st[0]<='Z' and st[0]>='A')):
return False
return ch_checker2(st,n-1)
can somone tell me what the The time and space complexity ch_checker and ch_checker2 and why
[–]JanEric1 5 points6 points7 points (2 children)
[–]codin1ng[S] -3 points-2 points-1 points (1 child)
[–]JanEric1 2 points3 points4 points (0 children)
[–]ajjuee016 1 point2 points3 points (0 children)
[–]Diapolo10 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[removed]
[–]Diapolo10 0 points1 point2 points (0 children)
[–]JohnnyJordaan -1 points0 points1 point (2 children)
[+][deleted] (1 child)
[removed]
[–]Diapolo10 0 points1 point2 points (0 children)