Can anyone explain how to calculate time complexity of this ?
func(line):
	for i in range(len(line)+1):
			pre,suf = line[:i],line[i:]
			func(suf)
				

This type of code is having time complexity 2^n. Can anyone explain why and how it is calculated?

Comments (2)