Skip to content

Commit d3ba3d5

Browse files
authored
Merge pull request #199 from js0805/master
Created the solution for 154
2 parents 7e5d56f + 07b8a9e commit d3ba3d5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

leetcode/cpp/Array/154.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public:
3+
int findMin(vector<int>& nums) {
4+
int t = INT_MAX;
5+
for (int i = 0; i < nums.size(); i++)
6+
{
7+
if (nums[i] < t)
8+
{
9+
t = nums[i];
10+
}
11+
}
12+
return t;
13+
}
14+
};

0 commit comments

Comments
 (0)