PS

    LeetCode / Tree / 110번 / Balanced Binary Tree / JS

    Balanced Binary Tree - LeetCode Can you solve this real interview question? Balanced Binary Tree - Given a binary tree, determine if it is height-balanced. Example 1: [https://assets.leetcode.com/uploads/2020/10/06/balance_1.jpg] Input: root = [3,9,20,null,null,15,7] Output: true Exam leetcode.com 균형잡힌 이진트리인지 boolean 값으로 반환하는 문제이다. 여기서 균형잡힌 이진트리란, 왼쪽과 오른쪽의 subtree의 depth가..

    LeetCode / Tree / 226번 / Invert Binary Tree / JS

    Invert Binary Tree - LeetCode Can you solve this real interview question? Invert Binary Tree - Given the root of a binary tree, invert the tree, and return its root. Example 1: [https://assets.leetcode.com/uploads/2021/03/14/invert1-tree.jpg] Input: root = [4,2,7,1,3,6,9] Output: [4 leetcode.com 주어진 트리를 좌우반전시켜 반환하는 문제이다. /** * Definition for a binary tree node. * function..

    LeetCode / Greedy / 621번 / Task Scheduler / JS

    Task Scheduler - LeetCode Can you solve this real interview question? Task Scheduler - Given a characters array tasks, representing the tasks a CPU needs to do, where each letter represents a different task. Tasks could be done in any order. Each task is done in one unit of time. F leetcode.com 해야하는 작업들의 리스트와 n이 주어진다. 여기서 n은 같은 작업을 잇따라 해야할 시에 중간에 반드시 텀을 둬야하는 시간이다.(유휴시간) 예..

    LeetCode / Greedy / 2131번 / Longest Palindrome by Concatenating Two Letter Words / JS

    Longest Palindrome by Concatenating Two Letter Words - LeetCode Can you solve this real interview question? Longest Palindrome by Concatenating Two Letter Words - You are given an array of strings words. Each element of words consists of two lowercase English letters. Create the longest possible palindrome by selecting leetcode.com words 리스트에서 단어들을 뽑아 조합해서 가장 긴 팰린드롬(좌우대칭)..

    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..