CodingTest에 해당하는 글 63

  1. [LeetCode] Unique Number of Occurrences 2025.04.24

    https://leetcode.com/problems/unique-number-of-occurrences/description/?envType=study-plan-v2&envId=leetcode-75 Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise. Example 1: Input: arr = [1,2,2,1,1,3] Output: true Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of o..


  2. [LeetCode] Find the Difference of Two Arrays 2025.04.23

    https://leetcode.com/problems/find-the-difference-of-two-arrays/description/?envType=study-plan-v2&envId=leetcode-75 Given two 0-indexed integer arrays nums1 and nums2, return a list answer of size 2 where: answer[0] is a list of all distinct integers in nums1 which are not present in nums2. answer[1] is a list of all distinct integers in nums2 which are not present in nums1. Note that the integ..


  3. [LeetCode] Find Pivot Index 2025.04.22

    https://leetcode.com/problems/find-pivot-index/?envType=study-plan-v2&envId=leetcode-75 Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the left of the index is equal to the sum of all the numbers strictly to the index's right. If the index is on the left edge of the array, then the left sum is 0 ..


  4. [LeetCode] Find the Highest Altitude 2025.04.21

    https://leetcode.com/problems/find-the-highest-altitude/description/?envType=study-plan-v2&envId=leetcode-75 There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0.You are given an integer array gain of length n where gain[i] is the net gain in altitude between points i​​​​​​ and i + 1 for a..


  5. [LeetCode] Longest Subarray of 1's After Deleting One Element 2025.04.17

    https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element/description/?envType=study-plan-v2&envId=leetcode-75 Given a binary array nums, you should delete one element from it.Return the size of the longest non-mpty subarray containing only 1's in the resulting array.Return 0 if there is no such subarray. Example 1:Input: nums = [1,1,0,1] Output: 3 Explanation: After deleti..


  6. [LeetCode] Max Consecutive Ones III 2025.04.16

    https://leetcode.com/problems/max-consecutive-ones-iii/description/?envType=study-plan-v2&envId=leetcode-75 Given a binary array nums and an integer k, return the maximum number of consecutive 1's in the array if you can flip at most k 0's. Example 1:Input: nums = [1,1,1,0,0,0,1,1,1,1,0], k = 2 Output: 6 Explanation: [1,1,1,0,0,1,1,1,1,1,1] Bolded numbers were flipped from 0 to 1. The longest su..


  7. [LeetCode] Maximum Number of Vowels in a Substring of Given Length 2025.04.15

    https://leetcode.com/problems/maximum-number-of-vowels-in-a-substring-of-given-length/description/?envType=study-plan-v2&envId=leetcode-75 Given a string s and an integer k,return the maximum number of vowel letters in any substring of s with length k.Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'. Example 1:Input: s = "abciiidef", k = 3 Output: 3 Explanation: The substring "iii" conta..


  8. [LeetCode] Maximum Average Subarray I 2025.04.14

    https://leetcode.com/problems/maximum-average-subarray-i/description/?envType=study-plan-v2&envId=leetcode-75 You are given an integer array nums consisting of n elements, and an integer k. Find a contiguous subarray whose length is equal to k that has the maximum average value and return this value. Any answer with a calculation error less than 10-5 will be accepted. Example 1:Input: nums = [1,..


  9. [LeetCode] Max Number of K-Sum Pairs 2024.12.11

    https://leetcode.com/problems/max-number-of-k-sum-pairs/description/?envType=study-plan-v2&envId=leetcode-75 You are given an integer array nums and an integer k.In one operation, you can pick two numbers from the array whose sum equals k and remove them from the array.Return the maximum number of operations you can perform on the array. Example 1:Input: nums = [1,2,3,4], k = 5Output: 2Explanati..


  10. [LeetCode] Product of Array Except Self 2024.11.24

    https://leetcode.com/problems/product-of-array-except-self/description/?envType=study-plan-v2&envId=leetcode-75 Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer.You must write an algorithm that runs in O(n) time and without..