Algorithm · Expedia · Hard
This problem has three independent string-processing parts. Part 1: Count-and-Say Term Let the initial term be s1 = "1". Each following term is formed by scanning the preceding term from left to right, identifying maximal runs of the same digit, and appending each run's length followed by the digit. Thus, one 1 becomes "11", two 1s become "21", and so on. For an integer n, return the term at position n. Part 2: Palindrome-Rearrangeable Substrings You are given an array of…
Checking your access…