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

Last updated