알고리즘 문제풀이/LeetCode
LeetCode 33번 - Search in Rotated Sorted Array
leetcode.com/problems/search-in-rotated-sorted-array/submissions/ Search in Rotated Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public: int search(vector& nums, int target) { int l = 0; int r = nums.size()-1; while(l target){ //일반적인 경우와 다를때: r의 값..
LeetCode 41번 - First Missing Positive
leetcode.com/problems/first-missing-positive/ First Missing Positive - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public: int firstMissingPositive(vector& nums) { set s(nums.begin(),nums.end()); int size = nums.size(); int result = 1; for(result = 1; result
LeetCode 448번 - Find All Numbers Disappeared in an Array
leetcode.com/problems/find-all-numbers-disappeared-in-an-array/ Find All Numbers Disappeared in an Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { public: vector findDisappearedNumbers(vector& nums) { vector result; set s; vector last; for(int i=0; i