LeetCode 189.

less than 1 minute read

Intuition keep a subarray of right side of array and replace right side of it by left side. After that, replace the other side.

LeetCode 80.

less than 1 minute read

Intuition An intuitive thought: iterate the given array and record the steps that number on current index needed to be replaced forward. Then, this implemen...

Prime Number

1 minute read

Intro Approach 1 gives the method to test whether n is a prime number.

LeetCode 204.

1 minute read

Intuition On first glimpse, I try DP and turn out TLE, shit again.

LeetCode 278.

less than 1 minute read

Intuition Binary Seaching to find the answer