본문 바로가기

반응형

리트코드

(55)
[리트코드] 438. Find All Anagrams in a String - js (sliding window) 1. 문제 https://leetcode.com/problems/find-all-anagrams-in-a-string/description/ Find All Anagrams in a String - LeetCode Can you solve this real interview question? Find All Anagrams in a String - Given two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order. An Anagram is a word or phrase formed by rearrangi leetcode.com 2. 코드 이 ..
[리트코드] 70. Climbing Stairs - js (메모이제이션) 1. 문제 https://leetcode.com/problems/climbing-stairs/description/ Climbing Stairs - LeetCode Can you solve this real interview question? Climbing Stairs - You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Outpu leetcode.com 2. 코드 처음 짠 코드) 타임 아웃 /** * @param {numb..
[리트코드] 14. Longest Common Prefix - js 1. 문제 https://leetcode.com/problems/longest-common-prefix/ 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 2. 코드 /** * @param {string[]} strs * @r..
[리트코드] 2806. Account Balance After Rounded Purchase - js 1. 문제 https://leetcode.com/problems/account-balance-after-rounded-purchase/ Account Balance After Rounded Purchase - LeetCode Can you solve this real interview question? Account Balance After Rounded Purchase - Initially, you have a bank account balance of 100 dollars. You are given an integer purchaseAmount representing the amount you will spend on a purchase in dollars. At the leetcode.com 2. ..
[리트코드] 34. Find First and Last Position of Element in Sorted Array - js (투포인터) 1. 문제 https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ Find First and Last Position of Element in Sorted Array - LeetCode Can you solve this real interview question? Find First and Last Position of Element in Sorted Array - Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target..
[리트코드] 205. Isomorphic Strings - js 1. 문제 https://leetcode.com/problems/isomorphic-strings/ Isomorphic Strings - LeetCode Can you solve this real interview question? Isomorphic Strings - Given two strings s and t, determine if they are isomorphic. Two strings s and t are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replace leetcode.com 2. 코드 이 문제는 설명을 이해하는데 조금 오래 걸렸다. Isomorphi..
[리트코드] 73. Set Matrix Zeroes - js (queue) 1. 문제 https://leetcode.com/problems/set-matrix-zeroes/ Set Matrix Zeroes - LeetCode Can you solve this real interview question? Set Matrix Zeroes - Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0's. You must do it in place [https://en.wikipedia.org/wiki/In-place_algorithm]. Example 1: [https leetcode.com 2.코드 /** * @param {number[][]} matrix * @return..
[리트코드] 300. Longest Increasing Subsequence - js (DP) 1. 문제 https://leetcode.com/problems/longest-increasing-subsequence/description/ Longest Increasing Subsequence - LeetCode Can you solve this real interview question? Longest Increasing Subsequence - Given an integer array nums, return the length of the longest strictly increasing subsequence. Example 1: Input: nums = [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest leetcode.com 2. 코드 정답 ..

반응형