https://leetcode.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/

Source


    int minPartitions(string n) {
        int maxN = 0;
        FOR (i, n.length()) {
            const int num = n[i] - '0';
            if (num > maxN) {
                maxN = num;
            }
        }
        return maxN;
    }

GitHub