1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "leetcode.h" class Solution { public: int minPartitions(string n) { char ans = '0'; for (char c : n) if (c > ans) ans = c; return ans - '0'; } }; int main() { Solution obj; string n = "32"; cout << obj.minPartitions(n); }