전체 글에 해당하는 글 293

  1. [LeetCode] Asteroid Collision 2025.05.01

    https://leetcode.com/problems/asteroid-collision/description/?envType=study-plan-v2&envId=leetcode-75 We are given an array asteroids of integers representing asteroids in a row. The indices of the asteriod in the array represent their relative position in space. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative mea..


  2. [LeetCode] Removing Stars From a String 2025.04.30

    https://leetcode.com/problems/removing-stars-from-a-string/description/?envType=study-plan-v2&envId=leetcode-75 You are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest non-star character to its left, as well as remove the star itself. Return the string after all stars have been removed. Note: The input will be generated such that the op..


  3. [LeetCode] Equal Row and Column Pairs 2025.04.29

    https://leetcode.com/problems/equal-row-and-column-pairs/description/?envType=study-plan-v2&envId=leetcode-75 Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is considered equal if they contain the same elements in the same order (i.e., an equal array).Example 1:Input: grid = [[3,2,1],[1,7,6],[2,7,7]..


  4. [LeetCode] Determine if Two Strings Are Close 2025.04.28

    https://leetcode.com/problems/determine-if-two-strings-are-close/description/?envType=study-plan-v2&envId=leetcode-75 Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. For example, abcde -> aecdb Operation 2: Transform every occurrence of one existing character into another existing character, and ..


  5. [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..


  6. [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..


  7. [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 ..


  8. [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..


  9. [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..


  10. [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..