전체 글 (501) 썸네일형 리스트형 [리트코드] 1870. Minimum Speed to Arrive on Time - js (이진탐색) 1. 문제 https://leetcode.com/problems/minimum-speed-to-arrive-on-time/ Minimum Speed to Arrive on Time - LeetCode Can you solve this real interview question? Minimum Speed to Arrive on Time - You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n trains in sequential order. Yo leetcode.com 2. 코드 /** * @par.. [리트코드] 13. Roman to Integer - js 1. 문제 https://leetcode.com/problems/roman-to-integer/ Roman to Integer - LeetCode Can you solve this real interview question? Roman to Integer - Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw leetcode.com 2. 코드 /** * @param {string} s * @return {number} .. [리트코드] 42. Trapping Rain Water - js 1. 문제 https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com 2. 코드 풀이 과정을 생각하기 정말 어려운 문제인 것 같다. 그래서 Hard.. [리트코드] 2784. Check if Array is Good - js 1. 문제 https://leetcode.com/problems/check-if-array-is-good/ 2. 코드 /** * @param {number[]} nums * @return {boolean} */ var isGood = function(nums) { let sortedNums = nums.sort((a,b) => a-b); if(sortedNums[sortedNums.length-1] !== sortedNums[sortedNums.length-2]) return false; for(let i=0;i [리트코드] 75. Sort Colors - js 1. 문제 https://leetcode.com/problems/sort-colors/ 2. 코드 /** * @param {number[]} nums * @return {void} Do not return anything, modify nums in-place instead. */ var sortColors = function(nums) { for(let i=0;i [리트코드] 35. Search Insert Position - js (이진탐색) 1. 문제 https://leetcode.com/problems/search-insert-position/ Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must w leetcode.com 2. 코드 /** * @param {number[]} nums .. [리트코드] 283. Move Zeroes - js (투포인터) 1. 문제 https://leetcode.com/problems/move-zeroes/description/ Move Zeroes - LeetCode Can you solve this real interview question? Move Zeroes - Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. E leetcode.com 2. 코드 처음 작성한 코드) 오답 nums = [0,0,1] 일 경우 답이 [0,1.. [리트코드] 3. Longest Substring Without Repeating Characters - js (슬라이딩 윈도우) 1. 문제 https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ 이전 1 2 3 4 5 6 7 8 ··· 63 다음