> For the complete documentation index, see [llms.txt](https://liuzhenglaichn.gitbook.io/algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://liuzhenglaichn.gitbook.io/algorithm/math/get-digits.md).

# Get Digits

When you want to get all the digits of a integer `n`, instead of doing `n /= 10, n % 10`, use `to_string(n)`. It's shorter and less error-prone. For example, you don't need to consider `n = 0`.

## Problems

* [2191. Sort the Jumbled Numbers (Medium)](https://leetcode.com/problems/sort-the-jumbled-numbers/)
