We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85103aa commit 2d6fe66Copy full SHA for 2d6fe66
1 file changed
lkhyun/202511/29 PGM Lv2 최댓값과 최솟값.md
@@ -0,0 +1,17 @@
1
+```java
2
+class Solution {
3
+ public String solution(String s) {
4
+ int min = Integer.MAX_VALUE;
5
+ int max = Integer.MIN_VALUE;
6
+ String[] splited = s.split(" ");
7
+
8
+ int idx = 0;
9
+ for(String n : splited){
10
+ int num = Integer.parseInt(n);
11
+ min = Math.min(min, num);
12
+ max = Math.max(max, num);
13
+ }
14
+ return min + " " + max;
15
16
+}
17
+```
0 commit comments