The count-and-say sequence is built by reading off the previous term as consecutive runs of digits. Term 1 is 1 . To produce the next term, replace each run of equal digits with its count followed by the digit — for example 3322251 reads as three 3s, two 2s, one 5, one 1 → 23 + 22 + 15 + 11 = 33221511 ... i.e. 3322251 → 23 22 15 11 . Return the n -th term. Input format Input is [n] , e.g. [4] .