Given an integer n (1 ≤ n ≤ 99) and a digit string s formed by concatenating the decimal representations of the integers 1..n except for one missing number k, write a function to return k. Part A: s preserves the natural order (e.g., n=5, s="1234" → k= 5). Part B: s’s characters are arbitrarily permuted (e.g., n=13, s could be a shuffle of the digits of all numbers 1..13 except k). Numbers have no delimiters; 1–9 are one digit, 10–99 are two digits. Explain your approach and time/space complexity.