
Question There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time. Given the two integers m and n, return the number of possible unique paths that the robot can take to reach the bottom-right corner. T..

Question 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 reach the last index, or false otherwise. 정수 배열 숫자가 제공됩니다. 처음에는 배열의 첫 번째 인덱스에 위치하며 배열의 각 요소는 해당 위치에서 최대 점프 길이를 나타냅니다. 마지막 인덱스에 도달할 수 있으면 true를 반환하고 그렇지 않으면 false를 반환합니다. 제약사항 1

Question Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. integer 타입의 정수로 이루어진 배열이 주어졌을 때, 가능한 모든 순열을 return 하라. return 하는 순서는 상관없다. 제약사항 배열의 길이는 1이상 6 이하 배열 각 원소의 값은 -10 이상 10 이하. 배열의 모든 원소는 unique 하다. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 모든 순열을 순회하는 문제이다. 어떤 방식으로 하건 모든 원소는 최소 한 번씩은 조회해보아야 한다. 따라서 BCR은 O(n)이다..

Question Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums [i] < nums [j] < nums [k]. If no such indices exists, return false. 정수 배열 nums가 주어질 때, 인덱스 i, j, k에 대하여, i < j < k를 만족하고, nums [i] < nums [j] < nums [k]를 만족하는 triplet이 있으면 true를 반환하라. 그렇지 않으면 false를 반환하라. 제약사항 배열 nums의 길이는 1 이상5 * 10^5 이하이다. -2^ 31

Question COUNT and SAY 시퀀스는 재귀 공식으로 정의된 일련의 숫자 문자열이다. Countandsay (1) = "1" Countandsay (N)는 Countandsay (N-1)의 숫자 문자열을 "말하는"방식으로, 다른 숫자 문자열로 변환된다. 쉽게 말해 Countandsay (n)은 Countandsay (n-1) 을 읽어 반환하는 것인데, 읽는 방식은 아래와 같다. Countandsay (1) = "1" Countandsay (2) = Countandsay (1) 은 1개의 1 = "11" Countandsay (3) = Countandsay (2) 은 2개의 1 = "21" Countandsay (4) = Countandsay (3) 은 1개의 2 , 1개의 1 = "1211" ..

Question 싱글 링크드 리스트의 헤드가 주어지면 홀수번째 노드를 함께 그룹화한 다음 짝수 번째 노드를 그룹화하여 홀수 그룹의 마지막에 짝수 그룹을 연결한 재 정렬된 리스트를 반환하라. 첫 번째 노드는 홀수로 간주되고, 두 번째 노드는 짝수로 간주된다. 짝수 그룹과 홀수 그룹 모두 내부의 상대적인 순서는 입력에서와 같이 유지되어야 한다는 점에 유의한다. O(1) 공간 복잡도와 O(n) 시간 복잡도에서 문제를 풀어야 한다. 제약사항 주어진 리스트의 개수는 최소 0개 최대 10^4개 이다. 노드의 값은 최소 -10^6 최대 10^6이다. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 모든 노들들을 최소 한 번식은 봐야 하기 때문에 O(n)이다. 고려사항 노..

Question 문자열 s가 주어졌을 때, 한 문자가 두 번 이상 등장하지 않는 가장 긴 부분 문자열을 찾아 그 길이를 return 하라. 제약사항 s의 길이는 0 이상 5 * 10^4 이하이다. s는 영문, 숫자 및 심벌과 공백으로 이루어져 있다. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 모든 문자열의 문자들을 최소 한 번식은 봐야 하기 때문에 O(s)이다. 고려사항 제약사 항의 영문 이외의 문자가 들어갈 경우 Solution1 - Brute Force 가장 긴 문자열부터 문자열의 길이를 하나씩 줄여가면서, 중복된 문자가 있는지 판단한다 substr의 길이가 s일 때 1번(s) substr의 길이가 s-1 일때 2번(s-1) substr의 길이가 s..

Question 배열 nums 와 red, white, blue로 이루어진 n개의 객체들이 있을 때, 해당 객체들을 같은 color끼리 인접하게 in-place로 정렬하라. 반드시 sort 라이브러리를 쓰지않고 정렬해야한다. 제약사항 n 은 nums.length() 와 같다 n은 최소 1 ~ 최대 300이다. nums[i] 는 0,1, 2 중 하나이다. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 모든 숫자를 한번 씩 확인해봐야 하기 때문에 n을 배열의 길이라 했을 때, BCR은 O(n) 이다 고려사항 빈 배열일 경우 (제약사항엔 1~300이지만, 고려해본다) Solution1 - Bruth Force 단순한 방법은 그냥 잘 알려진 정렬 라이브러리를 사용..
- Total
- Today
- Yesterday
- DP
- 솔직후기
- Medium
- 알고리즘
- 속초
- PS
- 러스트 입문
- 러스트
- LeetCode
- 속초 맛집
- 러스트 기초
- rust
- interview question
- 트리
- C++
- 인터뷰
- Problem Solving
- 자료구조
- algorithm
- Tree
- 반드시 알아야 할 자료구조
- 맛집
- ProblemSolving
- 코딩인터뷰
- Interview
- 러스트 배우기
- 리트코드
- coding interview
- 기술면접
- 내돈내산
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |