Last active
December 19, 2020 11:01
-
-
Save Yotamho/15290fb1b49c5cd89a8b7b0f0e5aab0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def int_to_string(ls, n, i = 0): | |
| if n == 0: | |
| ls[i] = '\0' | |
| return 0 | |
| else: | |
| idx = int_to_string(ls, n // 10, i+1) | |
| ls[idx] = str(n % 10) | |
| return idx + 1 | |
| ls = [''] * 100 | |
| int_to_string(ls, 1234567) | |
| print(ls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment