LeetCode

    LeetCode / Tree / 589번 / N-ary Tree Preorder Traversal / JS

    N-ary Tree Preorder Traversal - LeetCode Can you solve this real interview question? N-ary Tree Preorder Traversal - Given the root of an n-ary tree, return the preorder traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversal. Each group of chil leetcode.com 전위순회로 트리를 탐색하는 문제이다. 전위순회의 순서는 왼쪽 하위노드 -> 루트 -> 오른쪽 하위노드의 순서이다...

    LeetCode / Greedy / 409번 / Longest Palindrome / JS

    Longest Palindrome - LeetCode Can you solve this real interview question? Longest Palindrome - Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters. Letters are case sensitive, for example, leetcode.com 주어진 문자열의 문자들로 만들 수 있는 문자열 중 가장 긴 팰린드롬 문자열을 만들었을 때 그 길이가 몇인지 반환하면 되는 문제이다. * ..

    LeetCode / Greedy / 121번 / Best Time to Buy and Sell Stock / JS

    Best Time to Buy and Sell Stock - LeetCode Can you solve this real interview question? Best Time to Buy and Sell Stock - You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a single day to buy one stock and choosin leetcode.com 당일의 주가들이 배열로 주어진다. 언제 매수를 해서 언제 매도를 하면 가장 큰 수익을 낼 수 있는지 확인한 후..

    LeetCode / Linked List / 142번 / Linked List Cycle II / JS

    Linked List Cycle II - LeetCode Can you solve this real interview question? Linked List Cycle II - Given the head of a linked list, return the node where the cycle begins. If there is no cycle, return null. There is a cycle in a linked list if there is some node in the list that can be r leetcode.com 순환을 할 수도 있고, 순환하지 않을 수도 있는 Linked List가 주어진다. 만약 어딘가의 위치에서 순환이 이루어지고 있는 ..

    LeetCode / Linked List / 206번 / Reverse Linked List / JS

    Reverse Linked List - LeetCode Can you solve this real interview question? Reverse Linked List - Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: [https://assets.leetcode.com/uploads/2021/02/19/rev1ex1.jpg] Input: head = [1,2,3,4,5] O leetcode.com 주어진 Linked List의 노드의 순서를 반대로 바꾸면 되는 문제이다. /** * Definition for singly-linked..

    LeetCode / Linked List / 21번 / Merge Two Sorted Lists / JS

    Merge Two Sorted Lists - LeetCode Can you solve this real interview question? Merge Two Sorted Lists - You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists leetcode.com 주어진 두개의 Linked List를 하나의 List로 Merge하여 오름차순으로 정렬하면 되는 문제이다. /** * Defi..