본문 바로가기

LeetCode - Top Interview 150

(30)
[Java Script] 530. Minimum Absolute Difference in BST 1. 문제 개요 문제 링크 : 530. Minimum Absolute Difference in BST Minimum Absolute Difference in BST - LeetCode Can you solve this real interview question? Minimum Absolute Difference in BST - Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Example 1: [https://assets.l leetcode.com 이진트리가 주어지며 해당 트리의 주변값과의 차이중 ..
[Java Script] 153. Find Minimum in Rotated Sorted Array 1. 문제 개요 문제 링크 : 153. Find Minimum in Rotated Sorted Array Find Minimum in Rotated Sorted Array - LeetCode Can you solve this real interview question? Find Minimum in Rotated Sorted Array - Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: * [4,5,6,7,0,1,2] if it leetcode.com 정렬된 상태에서 일정 회전이 발생한 배열..
[Java Script] 33. Search in Rotated Sorted Array 1. 문제 개요 문제 링크 : 33. Search in Rotated Sorted Array Search in Rotated Sorted Array - LeetCode Can you solve this real interview question? Search in Rotated Sorted Array - There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1
[Java Script]162. Find Peak Element 1. 문제 개요 문제 링크 : 162. Find Peak Element Find Peak Element - LeetCode Can you solve this real interview question? Find Peak Element - A peak element is an element that is strictly greater than its neighbors. Given a 0-indexed integer array nums, find a peak element, and return its index. If the array contains multiple peaks, leetcode.com 주어진 배열의 값을 가장 큰 peek값의 인덱스를 반환하는 문제입니다. 단 시간복잡도를 O(log n) 으..
[Java Script]LeetCode 148. Sort List 1. 문제 개요 문제 링크 : 148. Sort List 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 주어진 링크드 리스트 내의 값을 오름차순으로 정렬하여 반환해 주면 되는 문제입니다. 2. 문제 풀이 문제 해결을 위해서 링크드 리스트의 노드..
[Java Script]LeetCode 1. Two Sum 1. 문제 개요 문제 링크 : 1. Two Sum Two Sum - LeetCode Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not leetcode.com 주어진 값이 배열내의 몇번째 인자끼리의 합으로 만들어진 값인지 구하여라 2. 문제 풀이 간단하게 풀이하면 각각의 요소를 더했을때 결과값이 나오는지 ..
[Java Script]LeetCode 242. Valid Anagram 1. 문제 개요 문제 링크 : 242. Valid Anagram Valid Anagram - LeetCode Can you solve this real interview question? Valid Anagram - Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using leetcode.com 주어진 문자열이 서로 anagram 인지 체크하는 문제입니다. 에너그럼의 정의는 아래 사진과 같은데 문장을 구성한 문자의..
[Java Script]LeetCode 383. Ransom Note 1. 문제 개요 문제 링크 : 383. Ransom Note Ransom Note - LeetCode Can you solve this real interview question? Ransom Note - Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise. Each letter in magazine can only be used once in ranso leetcode.com 주어진 두 개의 배열에서 하나의 배열이 구성값들로 나머지 배열이 구성되어 있는 체크 하여라 2. 문제 풀이 우선 가장 먼저 해야..
[Java Script]LeetCode 219. Contains Duplicate II 1. 문제 개요 문제 링크 : 219. Contains Duplicate II Contains Duplicate II - LeetCode Can you solve this real interview question? Contains Duplicate II - Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j)
[Java Script]LeetCode 150. Evaluate Reverse Polish Notation 1. 문제 개요 문제 링크 : 150. Evaluate Reverse Polish Notation Evaluate Reverse Polish Notation - LeetCode Can you solve this real interview question? Evaluate Reverse Polish Notation - You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation [http://en.wikipedia.org/wiki/Reverse_Polish_notation]. Evaluate t leetcode.com 배열에 들어가있는 값을 주어진 연산식을 이용하요 결과..