Question Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers in each column are sorted in ascending from top to bottom. m x n 정수 행렬 행렬에서 값 대상을 찾는 효율적인 알고리즘을 작성하십시오. 이 행렬에는 다음과 같은 속성이 있습니다. 각 행의 정수는 왼쪽에서 오른쪽으로 오름차순으로 정렬됩니다. 각 열의 정수는 위에서 아..
Question 중복 원소 없애기 정렬되어 있지 않은 연결 리스트가 주어졌을 때 이 리스트에서 중복되는 원소를 제거하는 코드를 작성하라. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 모든 리스트의 요소들을 다 확인해봐야 하기 때문에 리스트의 최대길이를 n이라 했을 때 O(n)이다. 고려사항 리스트 원소의 자료형을 int 타입으로 가정한다. Solution1 (Bruth Force) 가장 간단한 방법이다. 첫 요소부터 순차적으로 탐색하며 같은 원소가 있으면 연결해주는 방식이다. 이 방식은 버퍼를 사용하지 않지만, 공간 복잡도에서 이득이 있다. void solution(ListNode* head) { while(head !=NULL){ ListNode* co..
Question Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. 오름차순으로 정렬된 정수 배열이 주어지면 주어진 목표 값의 시작 위치와 끝 위치를 찾습니다. 배열에서 target을 찾을 수 없으면 [-1, -1]을 반환합니다. 시간 복잡도가 O(log n)인 알고리즘을 작성해야 합니다. 제약사항 0
Question A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed 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] = -∞. In other words, an element is always considered to be strictly greater than a neighbor that is outside the array..
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 비트 뒤집기 어떤 정수가 주어졌을 때 여러분은 이 정수의 비트 하나를 0에서 1로 바꿀 수 있다. 이때 1이 연속으로 나올 수 있는 가장 긴 길이를 구하는 코드를 작성하라. ex) input: 1775 ( 11011101111 ) output : 8 제약사항 고려사항 주어진 정수의 자료형 이 무엇인지 ? : int로 가정하고 푼다. Solution 가능한 최선의 수행 시간(Best Conceivable Runtime(BCR) 최소 주어진 정수의 자료형의 가능한 bit수만큼은 탐색해야 한다. Solution1 (Bruth Force) 가장 쉽게 생각할 수 있는 solution은 모든 0에 1을 넣어보고 가장 긴 연속된 1의 개수를 찾는 것이다. 그렇다면 0의 개수만큼 반복해야 하기 때문에 ..
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
- Total
- Today
- Yesterday
- 솔직후기
- LeetCode
- 러스트
- C++
- Interview
- 맛집
- ProblemSolving
- 자료구조
- 트리
- 인터뷰
- 코딩인터뷰
- Problem Solving
- 내돈내산
- DP
- Tree
- 러스트 배우기
- coding interview
- interview question
- 러스트 기초
- 리트코드
- 속초
- rust
- 속초 맛집
- Medium
- 알고리즘
- 반드시 알아야 할 자료구조
- PS
- algorithm
- 러스트 입문
- 기술면접
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |