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.
2 parents 39aa427 + 8f9fb9e commit 442ef44Copy full SHA for 442ef44
0224LJH/202510/20 PGM 최댓값과 최솟값.md
@@ -0,0 +1,21 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+class Solution {
6
+ public String solution(String s) {
7
+ StringTokenizer st = new StringTokenizer(s);
8
+ int min = Integer.MAX_VALUE;
9
+ int max = Integer.MIN_VALUE;
10
+ while(st.hasMoreTokens()){
11
+ int num = Integer.parseInt(st.nextToken());
12
+ min = Math.min(min,num);
13
+ max = Math.max(max,num);
14
+ }
15
+ StringBuilder sb = new StringBuilder();
16
+ sb.append(min).append(" ").append(max);
17
+ String answer = sb.toString();
18
+ return answer;
19
20
+}
21
+```
0 commit comments