목록전체 글 (117)
몰입공간
#1. 문제 https://leetcode.com/problems/search-insert-position/description/ Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must w leetcode.com 고유한 정수 값으로 채워진 정렬 배열 n..
#1. 문제 https://leetcode.com/problems/longest-substring-without-repeating-characters/ int: sub = "" max_len = 0 for i in range(len(s)): char = s[i] if char in sub: duplicated_idx = sub.index(char) sub = sub[duplicated_idx + 1 :] + char else: sub += char max_len = max(max_len, len(sub)) return max_len 문자열 s의 원소를 차례대로 더해가면서 substring을 만들어준다. 더하려는 문자가 이미 substring안에 있다면 substring안의 중복 문자열까지 버린 후 이후 ..
#1. 주간 요약 알고리즘 / 자료구조 Leetcode 150 챌린지 프리온보딩 인턴십 #2. 느낀점 비록 미디엄 난이도라도, 예전이였으면 건들지도 못할 문제들은 조금씩 풀어나가는 과정을 보면서 나름 뿌듯함을 느낀다. 확실히 배운 여러 패턴들과 사고방식이 도움이 된다. 남들이 30분 걸리는 문제를 하루를 다 써도 못푸는 경우가 있는데, 이럴때는 시간을 이렇게 투자하는 것이 맞나 싶다. #3. 다음주 알고리즘 및 리트코드 150 챌린지 프리온보딩 인턴십
#1. 문제 https://leetcode.com/problems/minimum-size-subarray-sum/description Minimum Size Subarray Sum - LeetCode Can you solve this real interview question? Minimum Size Subarray Sum - Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarr leetcode.com 양의 정수로 이루어진 nums..
#1. 문제 https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ Two Sum II - Input Array Is Sorted - LeetCode Can you solve this real interview question? Two Sum II - Input Array Is Sorted - Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two n leetcode.com 정수로 이루어진 1 ..
#1. 문제 https://leetcode.com/problems/valid-palindrome Valid Palindrome - LeetCode Can you solve this real interview question? Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric cha leetcode.com 주어진 문자열 s가 팰린드롬이면 True, 아니면 False를 반환하는 문제 Pal..
#1. 문제 https://leetcode.com/problems/jump-game Jump Game - LeetCode Can you solve this real interview question? Jump Game - You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can leetcode.com 정수로 이루어진 리스트 nums의 각 요소가 현재 인덱스에서 점프할 수 있는 최대 거리를 나타난다고 했을 때..

#1. 문제 https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii Best Time to Buy and Sell Stock II - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock II - You are given an integer array prices where prices[i] is the price of a given stock on the ith day. On each day, you may decide to buy and/or sell the stock. You can only hold leetcode.com 121번 문제의 심..