nikunjsoni

1689

May 26th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.17 KB | None | 0 0
  1. class Solution {
  2. public:
  3.     int minPartitions(string n) {
  4.         int maxN = 0;
  5.         for(char c: n)
  6.             maxN = max(maxN, c-'0');
  7.         return maxN;
  8.     }
  9. };
Advertisement
Add Comment
Please, Sign In to add comment