Skip to content

Commit 37699ed

Browse files
committed
leetcode_2160
1 parent b80d20c commit 37699ed

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
int minimumSum(int num) {
4+
vector<int> v={num%10};
5+
6+
while( num/=10){
7+
v.insert(lower_bound(v.begin(), v.end(), num%10), num%10);
8+
}
9+
return (v[0]*10+v[3]) + (v[1]*10 +v[2]);
10+
}
11+
};

0 commit comments

Comments
 (0)