일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- OS
- 리트코드
- 자바스크립트
- 백준
- 고득점Kit
- Medium
- python
- 프로그래머스
- LeetCode
- react
- 카카오
- Level3
- 파이썬
- web
- 프로그래밍
- CS
- 리액트
- Doitvue.js입문
- 배열
- 코테연습
- Level1
- 동적계획법
- C++
- javascript
- 웹프로그래밍
- Level2
- dp
- VUE
- typescript
- sql
- Today
- Total
목록리트코드 (22)
There is a programming language with only four operations and one variable X: ++X and X++ increments the value of the variable X by 1. --X and X-- decrements the value of the variable X by 1. Initially, the value of X is 0. /** * @param {string[]} operations * @return {number} */ var finalValueAfterOperations = function(operations) { return operations.reduce(((acc, cur) => cur[1] === '+'? ++acc:..
function dayOfTheWeek(day: number, month: number, year: number): string { const dayOfTheWeekArray = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] return dayOfTheWeekArray[new Date(year, month-1, day).getDay()] }; date 객체: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Date
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..