Question: def delete _ repeated _ substr ( x: int, y: str ) - > str: ' ' ' Delete all substrings where the same character

def delete_repeated_substr(x: int, y: str)-> str:
'''Delete all substrings where the same character is repeated at least x times in a row.'''
Starting from the top and considering each testcase in turn, please mark the 4 options that add nothing to what was covered by the previous tests.
x =1, y =, return: x =1, y =a, return: x =1,y =aa, return: x =1, y =b, return: x =2, y =a, return: ax =2, y =aa, return: x =2,y =abba, return: aax =2, y =aabbcd, return: cdx =3, y =yaaas, return: ysx =3, y =arto!!!!!, return: artox =3, y =suoaaami, return: suomix =3, y =aaabbbccddef, return: ccddef
def add_key_values(x: str)-> dict[str, int]:
'''Return a dictionary where the keys are the distinct characters appearing in x and the values are how many times they appear.'''
Starting from the top and considering each testcase in turn, please mark the 6 options that add nothing to what was covered by the previous tests.
x =, return: {}x =a, return {a: 1}x =ab, return {a: 1,b: 1}x =aab, return {a: 2,b: 1}x =1233, return: {1: 1,2: 1,3: 2}x =1223334444, return: {1: 1,2: 2,3: 3,4: 4}x =cabba, return: {c: 1,a: 2,b: 2}x =qnwhnwq", return: {q: 2,n: 2, w: 2,h: 1}x =a,aa33b, return {a: 3,,: 1,3: 2,b: 1}x =midterm", return {m: 2,i: 1,d: 1,t: 1,e: 1,r: 1}x =csc108ishard, return {c: 2,s: 2,1: 1,0: 1,8: 1,i: 1,h: 1,a: 1,r: 1,d: 1}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!