Question: What is the time complexity for this function? def count_all_palindrome(s): 1 = len (s) res = 0 for start in range(1-2): for end in range

What is the time complexity for this function?

def count_all_palindrome(s): 1 = len (s) res = 0 for start in range (1-2): for end in range (start + 1, 1): 

def count_all_palindrome(s): 1 = len (s) res = 0 for start in range(1-2): for end in range (start + 1, 1): is_palindrome = True this sts[start:end + 1] this_1 = len(this_st) for i in range(this_l): is_palindrome = is_palindrome and (this_st[i] res += is_palindrome return res == this st[this 1 - 1 -i])

Step by Step Solution

3.51 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The time complexity of the given function countallpalindrome can be anal... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!