본문 바로가기

전체 글

Daily Leetcoding Challenge 229. Majority Element II https://leetcode.com/problems/majority-element-ii LeetCode - The World's Leading Online Programming Learning Platform 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 직관 배열의 원소가 출현한 횟수를 Map에 저장해서 활용하는 문제를 여러 번 다뤄봤기 때문인지 바로 떠오른 방법은 원소를 키로 하고 출현 횟수를 값으로 하는 Map을 사용하는 것이다. 이 경우 Map에 최대 n개의 값이 저장.. 더보기
Daily Leetcoding Challenge 707. Design Linked List 연결리스트(링크드리스트)를 직접 설계해 보는 문제다. 연결리스트 문제를 풀다 보면 Singly linked list가 자주 보이기 때문에 그다지 어려운 문제는 아니지만, Doubly linked list를 구현해 볼 수 있는 기회가 잘 없으니 이중 연결 리스트를 구현해 봤다. 구현해야 하는 메서드 중에 addAtTail 메서드가 있기 때문에 그 편이 시간을 감소시켜 줄 수 있기도 하다. https://leetcode.com/problems/design-linked-list Design Linked List - LeetCode Can you solve this real interview question? Design Linked List - Design your implementation of the li.. 더보기
Daily Leetcoding Challenge 34. Find First and Last Position of Element in Sorted Array https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array LeetCode - The World's Leading Online Programming Learning Platform 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 한글날에 풀어보는 코테 문제. 주말에 시간 내서 풀기가 참 어렵지만 그래도 한 문제는 풀었다. ㅎㅎ 직관 이진 검색을 통해 lower bound, upper b.. 더보기
Daily Leetcoding Challenge 896. Monotonic Array LeetCode - The World's Leading Online Programming Learning Platform 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 직관 monotonic array란 주어진 배열 nums가 단조 증가(모든 i 더보기
Daily Leetcoding Challenge 1512. Number of Good Pairs 바쁜 일정으로 포스팅을 못하고 있었는데 추석 연휴까지 겹치면서 오랜만에 쓰게 됐다. 매일 한 문제씩만이라도 풀려고 하는데 꾸준히 하기가 참 어렵다. LeetCode - The World's Leading Online Programming Learning Platform 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 직관 주어진 배열에서 Good pair 정의에 맞는 숫자 쌍의 개수를 찾는 문제다. 인덱스가 i < j 인 순서 쌍 (i, j)는 nums[i] == nums[j] .. 더보기
Daily Leetcoding Challenge 1647. Minimum Deletions to Make Character Frequencies Unique 리트코드 서버가 UTC로 설정돼 있어서 매일 오전 9시에 날짜가 넘어간다. 그래서 아침에 워밍업으로 풀기에 적당한 것 같다. (어렵지 않은 것만..ㅎㅎ) https://leetcode.com/problems/minimum-deletions-to-make-character-frequencies-unique Minimum Deletions to Make Character Frequencies Unique - LeetCode Can you solve this real interview question? Minimum Deletions to Make Character Frequencies Unique - A string s is called good if there are no two different char.. 더보기
Daily Leetcoding challenge 1282. Group the People Given the Group Size They Belong To 오늘도 찾아온 데일리 챌린지 문제. 배열 & 맵을 사용하는 문제였다. https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to/description/?envType=daily-question&envId=2023-09-11 Group the People Given the Group Size They Belong To - LeetCode Can you solve this real interview question? Group the People Given the Group Size They Belong To - There are n people that are split into some unknown number o.. 더보기
Daily Leetcoding Challenge 377. Combination Sum IV 주말에도 한 문제. 식은 도출했지만... 마무리가 아쉬웠던 문제 https://leetcode.com/problems/combination-sum-iv/ Combination Sum IV - LeetCode Can you solve this real interview question? Combination Sum IV - Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target. The test cases are generated so that the answer can fi leetcode.com 직관 이 문제에서는 숫자.. 더보기