Can you solve this real interview question? 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 = [1,2,3,2,1], nums2 = [3,2,1,4
Can you solve this real interview question? 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 least two, and * t
https://leetcode.com/discuss/interview-question/742523/facebook-prep-question-contiguous-subarrays-on-solution 1int[] countSubarrays(int[] arr) {2intlen =arr.length;34Deque<Integer> stack =newArrayDeque<>();//index5int[] leftCount =newint[len];6//left[0] = 07stack.addLast(0);8for(...
Your LeetCode username gautan74 Category of the bug [ X ] Question [ X ] Solution Language Missing Test Cases Description of the bug Receiving Run Time Error ''' Line 1034: Char 34: runtime error: addition of unsigned offset to 0x6030000...
Can you solve this real interview question? 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-bit integer. E
Given an integer arraynumsand an integerk, returnthe length of the shortest non-emptysubarrayofnumswith a sum of at leastk. If there is no suchsubarray, return-1. Asubarrayis acontiguouspart of an array. Example 1: Input:nums = [1], k = 1Output:1 ...
Can you solve this real interview question? Sum of Subarray Minimums - Given an array of integers arr, find the sum of min(b), where b ranges over every (contiguous) subarray of arr. Since the answer may be large, return the answer modulo 109 + 7. Ex
Can you solve this real interview question? Maximum Sum of Two Non-Overlapping Subarrays - Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths firstLen and