일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- dp
- LeetCode
- VUE
- Level2
- javascript
- sql
- react
- CS
- 자바스크립트
- Level3
- 파이썬
- 프로그래머스
- 배열
- 프로그래밍
- 카카오
- 코테연습
- 백준
- Medium
- 웹프로그래밍
- Doitvue.js입문
- 동적계획법
- typescript
- 리트코드
- Level1
- web
- OS
- python
- 리액트
- C++
- 고득점Kit
- Today
- Total
목록코테 문제 풀이 (216)
16. 3Sum Closest 문제 Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution taget에 가장 가까운 세 수의 합 찾기 제한사항 3
15. 3Sum 문제 Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. 제한사항 0 List[List[int]]: nums.sort() answer = [] for i in range(len(nums) - 2): if i > 0 and nums[i] == nums[i - 1]: # 이미 체크한 값이면 패스 continue l, r = i + 1, len(nums..
494. Target Sum 문제 You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all the integers. For example, if nums = [2, 1], you can add a '+' before 2 and a '-' before 1 and concatenate them to build the expression "+2-1". Return the number of different express..
1. Two Sum 문제 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have *exactly* one solution, and you may not use the same element twice. You can return the answer in any order. 제한사항 1
287. Find the Duplicate Number 문제 Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nums, return this repeated number. You must solve the problem without modifying the array nums and uses only constant extra space. [1, n] 까지의 숫자가 들어 있는 배열에 추가로 하나의 숫자가 들어 갔을 때 추가된 숫자 찾기 제한사항 1 int: n = len(nums) - 1 ..
581. Shortest Unsorted Continuous Subarray 문제 Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order. Return the shortest such subarray and output its length. 어떤 부분 배열만 정렬하면 전체가 정렬되는 부분 배열 찾기 제한사항 1 end: return 0 tmp = nums[start:end + 1] tmpMin = min(tmp) tmpMax = max(tm..
581. Shortest Unsorted Continuous Subarray 문제 Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. 제한사항 1
162. Find Peak Element 문제 A peak element is an element that is strictly greater than its neighbors. Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks. You may imagine that nums[-1] = nums[n] = -∞. You must write an algorithm that runs in O(log n) time. 제한사항 1