LeetCode

    LeetCode / Two Pointer / 16번 / 3Sum Closese / JS

    3Sum Closest - LeetCode Can you solve this real interview question? 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 inp leetcode.com 주어진 nums 배열에서 3개의 수를 뽑아서 더했을 때, target 값과 가장 가까운 값을 반환하면 된다. /** * @param {numbe..

    LeetCode / Dynamic Programming / 416번 / Partition Equal Subset Sum / JS

    Partition Equal Subset Sum - LeetCode Can you solve this real interview question? Partition Equal Subset Sum - Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise. Example 1: I leetcode.com 주어진 nums 배열을 둘의 부분집합으로 나누었을 때, 그 둘의 부분집합 각각의 합이 같을 경우 true, 아니라면 fals..

    LeetCode / Dynamic Programming / 322번 / Coin Change / JS

    Coin Change - LeetCode Can you solve this real interview question? Coin Change - You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make leetcode.com 주어진 amount의 값을 만들기 위해 coins 배열에 담겨있는 coin의 동전을 최소 몇 개 써야하는지 반환하는 문제이다. 만약 coins의 ..

    LeetCode / Dynamic Programming / 198번 / House Robber / JS

    House Robber - LeetCode Can you solve this real interview question? House Robber - You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent ho leetcode.com 도둑이 연속해서 인접한 두 집을 연속해서 도둑질하면 경찰에게 걸린다. 따라서 인접한 두 집을 연속해서 도둑질 하지 않는다고 할 때 가장 많이 도..

    LeetCode / Graph / 210번 / Course Schedule II / JS

    Course Schedule II - LeetCode Can you solve this real interview question? Course Schedule II - There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take leetcode.com 총 들어야할 강의의 수인 numCourses와 선행 강의의 쌍인 prerequisites가 주어진다. 예를 들어 numCourses ..

    LeetCode / Graph / 417번 / Pacific Atlantic Water Flow / JS

    Pacific Atlantic Water Flow - LeetCode Can you solve this real interview question? Pacific Atlantic Water Flow - There is an m x n rectangular island that borders both the Pacific Ocean and Atlantic Ocean. The Pacific Ocean touches the island's left and top edges, and the Atlantic Ocean touches leetcode.com 각 칸에 있는 숫자는 그 땅의 높이라고 생각하면 된다. 따라서 그 칸에 있는 물은 현재 있는 칸의 높이보다 작거나 같..