js

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

    LeetCode / String / 14번 / Longest Common Prefix / JS

    Longest Common Prefix - LeetCode Can you solve this real interview question? Longest Common Prefix - Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow" leetcode.com 모든 문자열들에게 공통되는 가장 긴 접두사를 찾아서 반환한다. /** * @param {string[]} strs * @return ..

    LeetCode / Simulation / 54번 / Spiral Matrix / JS

    Spiral Matrix - LeetCode Can you solve this real interview question? Spiral Matrix - Given an m x n matrix, return all elements of the matrix in spiral order. Example 1: [https://assets.leetcode.com/uploads/2020/11/13/spiral1.jpg] Input: matrix = [[1,2,3],[4,5,6],[7,8,9]] Outpu leetcode.com 위와 같은 규칙을 가지면서 이동할 때, 이동한 순서를 담긴 배열을 반환한다. /** * @param {number[][]} matrix * @ret..