leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE | |
1539.cpp (160B)
1 class Solution { 2 public: 3 int findKthPositive(vector<int> &arr, int k) { 4 for (int n : arr) 5 if (n <= k) k++; 6 return k; 7 } 8 };