IT/알고리즘90 42] Leetcode 1528. Shuffle String https://leetcode.com/problems/shuffle-string/ Shuffle String - 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 ans와 s는 길이가 같을 테니 초기값을 s로 하고 하나씩 바꾼다. class Solution { public: string restoreString(string s, vector& indices) { string ans = s; for(int i = 0;i 2020. 8. 18. 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. 40] Leetcode 912. Sort an Array https://leetcode.com/problems/sort-an-array/ Sort 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 sortArray(vector& nums) { sort(nums.begin(), nums.end()); return nums; } }; ;;;; 2020. 8. 7. 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. 이전 1 ··· 10 11 12 13 14 15 16 ··· 23 다음