Math
1323. Maximum 69 Number
A number of 6s and 9s; you may flip at most one digit (6→9 or 9→6); return the maximum. Greedy: flip the highest-place 6 to a 9 — that gives the biggest gain, since higher digit positions carry more…
Loading…
A number of 6s and 9s; you may flip at most one digit (6→9 or 9→6); return the maximum. Greedy: flip the highest-place 6 to a 9 — that gives the biggest gain, since higher digit positions carry more…
Loading…