[Easy] 217. Contains Duplicate
leetCode/NeetCode 2022. 8. 2. 23:15

문제 Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct. 주어진 nums 배열 요소 중 중복되는 값이 있다면 true, 없으면 false를 반환하라. 예시 Example 1: Input: nums = [1,2,3,1] Output: true Example 2: Input: nums = [1,2,3,4] Output: false Example 3: Input: nums = [1,1,1,3,3,4,3,2,4,2] Output: true 제약 조건 Constraints: 1

[Easy] 860. Lemonade Change
leetCode 2022. 7. 26. 00:11

문제 At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5. Note that you do not have any change in hand ..

[Medium] 304. Range Sum Query 2D - Immutable
leetCode 2022. 7. 15. 14:53

문제 Given a 2D matrix matrix, handle multiple queries of the following type: Calculate the sum of the elements of matrix inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). Implement the NumMatrix class: NumMatrix(int[][] matrix) Initializes the object with the integer matrix matrix. int sumRegion(int row1, int col1, int row2, int col2) Returns ..

[Medium] 910. Smallest Range II
leetCode 2022. 7. 15. 14:48

문제 You are given an integer array nums and an integer k. For each index i where 0

[Medium] 713. Subarray Product Less Than K
leetCode 2022. 7. 7. 12:19

문제 Given an array of integers nums and an integer k, return the number of contiguous subarrays where the product of all the elements in the subarray is strictly less than k. 정수 숫자와 정수 k의 배열이 주어지면, 부분 배열의 모든 원소의 곱이 k보다 확실히 작은 연속 부분 배열의 수를 반환한다. 예시 Example 1: Input: nums = [10,5,2,6], k = 100 Output: 8 Explanation: The 8 subarrays that have product less than 100 are: [10], [5], [2], [6], [10, 5], ..

[Medium] 49. Group Anagrams
leetCode 2022. 7. 6. 19:19

문제 Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. 문자열 문자열의 배열이 주어지면, 아나그램을 함께 그룹화합니다. 답변은 임의의 순서로 반환할 수 있습니다. 아나그램(Anagram)은 다른 단어나 구문의 글자를 재정렬하여 만들어진 단어나 구를 말합니다. 예시 Example 1: Input: strs = [..

[Medium] 503. Next Greater Element II
leetCode 2022. 7. 5. 10:50

문제 https://leetcode.com/problems/next-greater-element-ii/ Next Greater Element II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in ..

[Medium] 1630. Arithmetic Subarrays
leetCode 2022. 7. 5. 08:23

문제 https://leetcode.com/problems/arithmetic-subarrays/ Arithmetic Subarrays - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. M..