Algorithm

Best Time to Buy and Sell Stock(Easy)

less than 1 minute read Problem Solving

Best Time to Buy and Sell Stock Stock의 가격이 정수 배열로 주어진다. Stock의 가격이 날마다 변한다. 언제 사고 언제 팔아야 가장 큰 차익을 남기는 지 구하는 문제다.

Shuffle an Array(Med.)

1 minute read Problem Solving

Shuffle an Array 주어진 정수 배열을 무작위로 섞는 알고리즘을 디자인하면 되는 문제다. 모든 순열이 공평하게 생성되어야 한다.

Merge Sorted Array(Easy)

1 minute read Problem Solving

Merge Sorted Array 주어진 두 정수 배열(nums1, nums2)을 정렬된 하나의 배열로 합치는 문제다. 각 배열에 대해 m, n이 주어지는데 이는 정렬해야할 배열의 크기이다.

Remove Duplicates From Sorted Array(Easy)

1 minute read Problem Solving

Remove Duplicates From Sorted Array 주어진 정수 배열에서 중복된 인자를 제거하는 문제다. 주어진 배열을 수정해야하며, 중복되지 않은 인자의 갯수를 반환하면 된다.

Reversed Integer(Med.)

2 minute read Problem Solving

Reversed Integer signed 32-bit integer가 주어진다. 주어진 정수를 뒤집으면 된다.

Longest Palindrome Substring(Med.)

3 minute read Problem Solving

Longest Palindrome Substring 주어진 문자열에 대해 가장 긴 Palindrome을 찾는 문제다. 가령

Median of Two Sorted Arrays(Hard)

3 minute read Problem Solving

Median of Two Sorted Arrays 두개의 정렬이 되어 있는 배열이 주어진다. 두 정렬된 배열의 특정 원소를 찾는 문제로, 이번에는 중앙값(median)을 찾으면 된다.

Add Two Numbers(Med.)

1 minute read Problem Solving

Add Two Numbers 두개의 non-negative interger가 들어있는 Linked Lists가 주어진다.

Two Sum(Easy)

1 minute read Problem Solving

Two Sum 문제는 단순하다. integet 배열(nums)이 주어지고, integer의 목표값(target)이 주어진다. 배열에서 합이 target이 되는 두 element의 index를 반환하면 된다.