본문 바로가기

분류 전체보기

(18)
Youtube Channel https://www.youtube.com/channel/UCliKKH-OhkEUVkaE-q78xTw
Bitwise AND of Numbers Range (python) 문제 링크 : https://leetcode.com/problems/bitwise-and-of-numbers-range/ Bitwise AND of Numbers Range - 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 two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inc..
Longest Increasing Subsequence (python) 풀이 문제 링크 : https://leetcode.com/problems/longest-increasing-subsequence/ Longest Increasing Subsequence - 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 integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is a sequence tha..
보석 쇼핑 (카카오 인턴 2020 기출) 문제 링크 : https://programmers.co.kr/learn/courses/30/lessons/67258?language=python3 코딩테스트 연습 - 보석 쇼핑 ["DIA", "RUBY", "RUBY", "DIA", "DIA", "EMERALD", "SAPPHIRE", "DIA"] [3, 7] programmers.co.kr 진열된 순서대로 보석의 이름이 저장된 list가 매개변수로 주어질 때, 모든 종류의 보석을 1개 이상 포함하는 가장 짧은 구간을 반환하는 문제였습니다. (가장 짧은 구간이 여러 개 있다면 구간의 시작점이 가장 왼쪽에 있는 경우를 반환합니다.) 이번 문제에는 정확성 테스트와 효율성 테스트가 별개로 존재합니다. 1) 모든 경우를 탐색할 경우 진열된 보석의 정보가 저장된 ..
Making A Large Island - python solution 문제 링크 : https://leetcode.com/problems/making-a-large-island/ Making A Large Island - 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 문제 해설 n x n 크기의 행렬이 주어집니다. 단 한 번 행렬의 요소 0을 1로 바꿀 수 있습니다. 이 과정을 적용해서 얻을 수 있는 가장 큰 섬(island)의 크기를 반환하세요. 섬은 4방향으로 이어진 1로 이루어진 집합입니다. 제한 사항 n == grid.le..
3Sum Closest 문제 링크 : https://leetcode.com/problems/3sum-closest/ 3Sum Closest - 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 문제 해설 : n개의 정수로 이루어진 배열 nums가 주어집니다. nums의 요소 중 3개의 합이 target에 가장 가까운 경우를 찾아 그 합을 반환하세요. 각각의 입력에 대해 정확히 하나의 해답만 있다고 가정해도 좋습니다. 제한 사항 1) 3
Convert Sorted Array to Binary Search Tree 문제 링크 : https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ Convert Sorted Array to Binary Search Tree - 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 문제 해설 : 모든 요소(elements)가 오름차순으로 정렬된 정수 배열 nums가 주어집니다. 이 배열을 높이가 균형 잡힌 이진 탐색 트리로 변환하세요. 높이가 균형 잡힌 이진 탐색 트리란..
Binary Tree Pruning 문제 링크 : https://leetcode.com/problems/binary-tree-pruning/ Binary Tree Pruning - 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 문제 해설 : 이진 트리의 root가 주어집니다. 같은 tree에서 1을 포함하지 않는 subtree를 제거하여 반환하세요. 제한 사항 1) tree의 node의 개수는 [1, 200]을 만족합니다. 2) Node.val은 0 또는 1입니다. 두 가지 방법으로 문제를 해결했..
Number of Matching Subsequences 문제 링크 : https://leetcode.com/problems/number-of-matching-subsequences/ Number of Matching Subsequences - 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 문제 해설 : 문자열 s와 문자열 배열 words가 주어집니다. 이 때 s의 subsequence를 만족하는 words[i]의 개수를 반환하는 함수를 작성하세요. (subsequence는 기존 문자열에서 순서를 바꾸지 않고 char..
Number of Subarrays with Bounded Maximum 문제 링크 : https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/ Number of Subarrays with Bounded Maximum - 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 문제 해설 : 양수가 저장된 배열 nums와 두 양수 left, right가 주어집니다. ( left int: answer = 0 for start in range(len(nums)): maximum..