[LeetCode] 169. Majority Element
·
코딩테스트
leetcode.com/problems/majority-element/ Majority Element - 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 해시맵 중독..해시맵으로 문제 풀기 완료 Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume tha..
[LeetCode] 860. Lemonade Change
·
코딩테스트
leetcode.com/problems/lemonade-change/ Lemonade Change - 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 내가 고른 문제인데, 결국 못풀었다. 테스트케이스가 적은 경우에는 정상 작동하는데, 커지면 안되는 걸 보면 로직 어딘가 구멍이 있다는 뜻이겠지..? 근데 어디서 잘못된건지 도통 눈치를 못채겠다. 스터디 시간에 물어봐야겠다...😅 each lemonade costs $5 Customers are standing in ..
[LeetCode] 347. Top K Frequent Elements
·
코딩테스트
leetcode.com/problems/top-k-frequent-elements/ Top K Frequent Elements - 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 347. Top K Frequent Elements 문제 : 주어진 배열에서 가장 빈번하게 나오는 수를 k개수만큼 int [] 배열 형태로 리턴하는 문제 예시 1) Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] 예시 2) Input: nums = ..