본문 바로가기

leetcode48

41] Leetcode 1. Two Sum https://leetcode.com/problems/two-sum/ Two Sum - 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 twoSum(vector& nums, int target) { vectorans; for(int i = 0;i 2020. 8. 18.
39★] Leetcode 905. Sort Array By Parity Sort Array By Parity - 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 sortArrayByParity(vector& A) { vectorans; for(int i = 0;i 2020. 8. 6.
38] Leetcode 961. N-Repeated Element in Size 2N Array N-Repeated Element in Size 2N 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 repeatedNTimes(vector& A) { int array[10001] = {0}; int ans = 0; for(int i = 0;i 2020. 8. 5.
37] Leetcode 1380. Lucky Numbers in a Matrix https://leetcode.com/problems/lucky-numbers-in-a-matrix/ Lucky Numbers in a Matrix - 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 행에서 최소인 값 구하고 동시에 그 값의 열의 위치를 구한 후에 그 열에서 최대값이면 lucky class Solution { public: vector luckyNumbers (vector& matrix) { vectorans; int num = 10000000; .. 2020. 7. 21.