Company: Turing
Difficulty: medium
TuringEncoding Number Conversion Your friend needs your help to convert a number to TuringEncoding . He gave a number k which you have to convert to TuringEncoding using the following instructions: convert(1) = \"1\" convert(k) is the TuringEncoding of convert(k-1) . TuringEncoding is a compression method for strings that aims to reduce the length of the string by replacing consecutive identical characters (repeated 2 or more times) with a combination of the character itself and the count of consecutive occurrences. For example, consider the string \"44333811\". To apply the TuringEncoding compression, we identify repeating segments: Replace \"44\" with \"24\" (2 consecutive 4s) Replace \"333\" with \"33\" (3 consecutive 3s) Replace \"8\" with \"18\" (1 occurrence of 8) Replace \"11\" with \"11\" (1 occurrence of 1) By performing these replacements, the compressed string becomes \"24331811\" . Input Format A single integer n (the number to be converted). Output Format Print the TuringE