시작에 앞서, LeetCode가 프로그래머스, 백준 코딩테스트와의 차이점이 있다면 in-place를 요구합니다.반환이 아니라 전달받은 리스트 자체를 수정하는 것이고 메모리 사용량을 채점 요소로 여깁니다.이런 점을 통해서 메모리 사용량을 최소화하는 방향까지 고려해보는 코
Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relati
Given an integer array nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears at most twice. The r
Given an array nums of size n, return the majority element.The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume th
Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.Constraints:1 <= nums.length <= 10^5\-2^31 <=
You are given an array prices where pricesi is the price of a given stock on the ith day.You want to maximize your profit by choosing a single day to
You are given an integer array prices where pricesi is the price of a given stock on the ith day.On each day, you may decide to buy and/or sell the st
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 ju
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific targe
Question Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or
Given a string s, find the length of the longest substring without repeating characters.0 <= s.length <= 5 \* 10^4s consists of English letters,
Given head, the head of a linked list, determine if the linked list has a cycle in it.There is a cycle in a linked list if there is some node in the l
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes conta
You are given the heads of two sorted linked lists list1 and list2.Merge the two lists into one sorted list. The list should be made by splicing toget
Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if i
You are given an m x n integer matrix matrix with the following two properties:Each row is sorted in non-decreasing order.The first integer of each ro
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.Implement the MinStack class:MinStack() initializes t
You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation.Evaluate the expression. Return an inte
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each inpu
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums\[i] == nums\[j] and ab
Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise.Each le
Given two strings s and t, return true if t is an anagram of s, and false otherwise.An Anagram is a word or phrase formed by rearranging the letters o
Given an array of strings strs, group the anagrams together. You can return the answer in any order.An Anagram is a word or phrase formed by rearrangi
Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence.You must write an algorithm that runs in O(n)
Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree.The num
Question Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tr
Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bot
Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10^-5 of the actual answe
A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are va
Design a data structure that supports adding new words and finding if a string matches any previously added string.Implement the WordDictionary class:
Given an integer array nums and an integer k, return the kth largest element in the array.Note that it is the kth largest element in the sorted order,
You are given two integer arrays nums1 and nums2 sorted in non-decreasing order and an integer k.Define a pair (u, v) which consists of one element fr
Given a reference of a node in a connected undirected graph.Return a deep copy (clone) of the graph.Each node in the graph contains a value (int) and
You are given an n x n integer matrix board where the cells are labeled from 1 to n2 in a Boustrophedon style starting from the bottom left of the boa