38. 报数 水题 class Solution { public String next(String num) { String ans = ""; int i = 0; while (i < num.length()) { char ch = num.charAt(i); int cnt = 0; while (i < num.length() && ch == num.charAt(i)) { i++; cnt++; } ans += cnt; an…
The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as "one 2, then one 1…