We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2252a0e commit f82c1a8Copy full SHA for f82c1a8
src/main/java/com/fishercoder/solutions/_670.java
@@ -1,25 +1,5 @@
1
package com.fishercoder.solutions;
2
3
-/**
4
- * 670. Maximum Swap
5
- *
6
- * Given a non-negative integer, you could swap two digits at most once to get the maximum valued number.
7
- * Return the maximum valued number you could get.
8
-
9
- Example 1:
10
- Input: 2736
11
- Output: 7236
12
- Explanation: Swap the number 2 and the number 7.
13
14
- Example 2:
15
- Input: 9973
16
- Output: 9973
17
- Explanation: No swap.
18
19
- Note:
20
- The given number is in the range [0, 108]
21
22
- */
23
public class _670 {
24
public static class Solution1 {
25
public int maximumSwap(int num) {
0 commit comments