Skip to content

Commit 2573895

Browse files
committed
Auto Update@2019-04-1417:52:36.00
1 parent 99720d4 commit 2573895

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
public class Solution {
3+
4+
public int findMin(int[] nums) {
5+
int min = nums[0];
6+
for (int i = 0; i < nums.length; i++) {
7+
if (min > nums[i]) {
8+
min = nums[i];
9+
break;
10+
}
11+
}
12+
return min;
13+
}
14+
15+
public static void main(String[] args) {
16+
int[] nums = {4,5,6,7,0,1,2};
17+
System.out.println(new Solution().findMin(nums));
18+
}
19+
20+
}

0 commit comments

Comments
 (0)