분류 전체보기

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

    LeetCode / Implementation / 202번 / Happy Number / JS

    Happy Number - LeetCode Can you solve this real interview question? Happy Number - Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: * Starting with any positive integer, replace the number by the sum of the squar leetcode.com 양의 정수 n이 입력값으로 들어온다. n의 각 자리를 나누어서 각각 제곱을 한 뒤 더해준 것이 다음 수가 된다. 이 과정을 1이 될 때 까지 반..

    LeetCode / Heap / 692번 / Top K Frequent Words / JS

    Top K Frequent Words - LeetCode Can you solve this real interview question? Top K Frequent Words - Given an array of strings words and an integer k, return the k most frequent strings. Return the answer sorted by the frequency from highest to lowest. Sort the words with the same frequenc leetcode.com 단어들이 들어있는 배열 words 배열과 정수인 k가 들어온다. words 배열에서 가장 많이 나온 단어들을 순서대로 k개만 반환..