릿코드12 33] Leetcode 1304. Find N Unique Integers Sum up to Zero Find N Unique Integers Sum up to Zero - 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 sumZero(int n) { vectorans; if(n%2 == 0){ for(int i = 1;i 2020. 7. 15. 30★★] Leetcode 1010. Pairs of Songs With Total Durations Divisible by 60 Pairs of Songs With Total Durations Divisible by 60 - 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 #시간초과주의 for문 2번 돌리면 시간초과난다. 앞에 더해서 나머지가 0이 되는 숫자 갯수만큼 pair의 갯수가 늘어난다. class Solution { public: int numPairsDivisibleBy60(vector& time) { int vis[60] = {0}; int ans = 0; for(int i =.. 2020. 7. 10. 29★] Leetcode 1013. Partition Array Into Three Parts With Equal Sum https://leetcode.com/problems/partition-array-into-three-parts-with-equal-sum/ Partition Array Into Three Parts With Equal 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 int 벡터를 공백이 아니고 합이 같은 세 개의 부분 배열로 나눌 수 있는지 묻는 문제. class Solution { public: bool canThreePartsEqualSum(vec.. 2020. 7. 7. 26★] Leetcode 1491. Average Salary Excluding the Minimum and Maximum Salary Average Salary Excluding the Minimum and Maximum Salary - 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 1. 문제를 똑바로 이해하고 2. 반환값이 int인지 double인지 확인하고 class Solution { public: double average(vector& salary) { sort(salary.begin(), salary.end()); double total = 0.0; for(int i = 1;i 2020. 7. 5. 이전 1 2 3 다음