Mon Oct 09 2023 13:39:39 GMT+0000 (Coordinated Universal Time)
Saved by @aniket_chavan
a = "gegeekek" n = len(a) s = [] for i in range(n): s.append(a[i]) while len(s)>=4 and s[-4:] == ['g', 'e', 'e', 'k' ]: s.pop() s.pop() s.pop() s.pop() if len(s) == 0: print("Yes") else: print("NO")
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments