About 44,100 results
Open links in new tab
  1. Maximum Subarray - LeetCode

    Maximum Subarray - Given an integer array nums, find the subarray with the largest sum, and return its sum. Example 1: Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The …

  2. Maximum Product Subarray - LeetCode

    Maximum Product Subarray - Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32 …

  3. Contiguous Array - LeetCode

    Contiguous Array - Given a binary array nums, return the maximum length of a contiguous subarray with an equal number of 0 and 1. Example 1: Input: nums = [0,1] Output: 2 …

  4. Maximum Good Subarray Sum - LeetCode

    Maximum Good Subarray Sum - You are given an array nums of length n and a positive integer k. A subarray of nums is called good if the absolute difference between its first and last element …

  5. Continuous Subarray Sum - LeetCode

    Continuous Subarray Sum - Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise. A good subarray is a subarray where: * its length is at …

  6. Maximum Average Subarray I - LeetCode

    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.

  7. Subarray Sum Equals K - LeetCode

    Subarray Sum Equals K - Given an array of integers nums and an integer k, return the total number of subarrays whose sum equals to k. A subarray is a contiguous non-empty sequence …

  8. Maximum Subarray With Equal Products - LeetCode

    1. Please don't post any solutions in this discussion. 2. The problem discussion is for asking questions about the problem or for sharing tips - anything except for solutions. 3. If you'd like …

  9. Maximum Subarray Sum With Length Divisible by K - LeetCode

    Maximum Subarray Sum With Length Divisible by K - You are given an array of integers nums and an integer k. Return the maximum sum of a subarray of nums, such that the size of the …

  10. Maximum Length of Repeated Subarray - LeetCode

    Maximum Length of Repeated Subarray - Given two integer arrays nums1 and nums2, return the maximum length of a subarray that appears in both arrays. Example 1: Input: nums1 = …