PS/LeetCode
LeetCode / Linked List / 148번 / Sort List / JS
Sort List - LeetCode Can you solve this real interview question? Sort List - Given the head of a linked list, return the list after sorting it in ascending order. Example 1: [https://assets.leetcode.com/uploads/2020/09/14/sort_list_1.jpg] Input: head = [4,2,1,3] Output: [1, leetcode.com 리스트에 있는 노드들을 오름차순으로 정렬하는 문제이다. /** * Definition for singly-linked list. * function Lis..
LeetCode / Linked List / 328번 / Odd Even Linked List / JS
Odd Even Linked List - LeetCode Can you solve this real interview question? Odd Even Linked List - Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered od leetcode.com 홀수번째 노드들을 앞으로 오게 하고, 짝수번째 노드들은 뒤로 보낸다. /** * Definition for singly-linke..
LeetCode / Simulation / 1706번 / Where Will the Ball Fall / JS
Where Will the Ball Fall - LeetCode Can you solve this real interview question? Where Will the Ball Fall - You have a 2-D grid of size m x n representing a box, and you have n balls. The box is open on the top and bottom sides. Each cell in the box has a diagonal board spanning two corners o leetcode.com 문제에 있는 그림대로 공이 이동했을 경우 각 열마다의 공이 몇번째 열로 마지막에 나오는지 반환하는 문제이다. 만약 중간에 ..
LeetCode / Linked List / 234번 / Palindrome Linked List / JS
Palindrome Linked List - LeetCode Can you solve this real interview question? Palindrome Linked List - Given the head of a singly linked list, return true if it is a palindrome or false otherwise. Example 1: [https://assets.leetcode.com/uploads/2021/03/03/pal1linked-list.jpg] Input: hea leetcode.com 주어진 Linked List가 팰린드롬인지, 즉 앞으로해도 뒤로해도 같은지 판단하는 문제이다. /** * Definition for..
LeetCode / Linked List / 19번 / Remove Nth Node From End of List / JS
Remove Nth Node From End of List - LeetCode Can you solve this real interview question? Remove Nth Node From End of List - Given the head of a linked list, remove the nth node from the end of the list and return its head. Example 1: [https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg] leetcode.com 주어진 Linked List에서 뒤에서 n번째 요소를 제거하고 반환한다. /** * Definition for si..
LeetCode / String / 43번 / Multiply Strings / JS
Multiply Strings - LeetCode Can you solve this real interview question? Multiply Strings - Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library leetcode.com 문자열로 들어온 두 수의 곱을 반환하면 되는 문제이다. 단 문자열로 들어온 수는 정수의 범위를 넘는다. 그리고 되도록이면 BigInt 내장 ..