![[LeetCode] 670: Maximum Swap](http://i1.daumcdn.net/thumb/C120x120/?fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FcYZoEM%2FbtsJ9Mjmgqk%2FAAAAAAAAAAAAAAAAAAAAAN9At4BK4Yrxm3udGBCOfEEv1Q2eky6akgH61Hz_kWrC%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1751295599%26allow_ip%3D%26allow_referer%3D%26signature%3DyE4IV%252Bgc6SgftnN3DgdyRzipfRo%253D)
[LeetCode] 670: Maximum Swap
문제문제 링크 : 670: Maximum SwapYou are given an integer num. You can swap two digits at most once to get the maximum valued number.Return the maximum valued number you can get. Example 1:Input: num = 2736Output: 7236Explanation: Swap the number 2 and the number 7. Example 2:Input: num = 9973Output: 9973Explanation: No swap. Constraints:0 풀이class Solution {public: int maximumSwap(int num) { ..
- Computer Science/Problem Solve
- · 2024. 10. 17.