leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
commit | 250b2a522bb491ec6934fef0180978bb9e9bafb1 |
parent | 65c154a2ba279c85216dac7a1a2e1a087836153f |
author | Dimitrije Dobrota <mail@dimitrijedobrota.com> |
date | Mon, 6 Mar 2023 19:41:02 +0100 |
Daily Problem
Diffstat:A | Problems/1539.cpp | | | ++++++++ |
M | README.md | | | + |
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/Problems/1539.cpp b/Problems/1539.cpp
@@ -0,0 +1,8 @@
class Solution {
public:
int findKthPositive(vector<int> &arr, int k) {
for (int n : arr)
if (n <= k) k++;
return k;
}
};
diff --git a/README.md b/README.md
@@ -408,6 +408,7 @@ for solving problems.
| 1514 | Medium | [Path with Maximum Probability](Problems/1514.cpp) |
| 1519 | Medium | [Number of Nodes in the Sub-Tree With the Same Label](Problems/1519.cpp) |
| 1523 | Easy | [Count Odd Numbers in an Interval Range](Problems/1523.cpp) |
| 1539 | Easy | [Kth Missing Positive Number](Problems/1539.cpp) |
| 1544 | Easy | [Make The String Great](Problems/1544.cpp) |
| 1557 | Medium | [Minimum Number of Vertices to Reach All Nodes](Problems/1557.cpp) |
| 1567 | Medium | [Maximum Length of Subarray With Positive Product](Problems/1567.cpp) |