Episode 7 — DSA with JavaScript / 7.8 — Advanced Array Problems

7.8 — Exercise Questions: Advanced Arrays

<< Overview


E1. Container With Most Water

Solution (JS)
function maxArea(h){let l=0,r=h.length-1,mx=0;while(l<r){mx=Math.max(mx,Math.min(h[l],h[r])*(r-l));h[l]<h[r]?l++:r--;}return mx;}

E2. Three Sum

Solution (JS)
function threeSum(nums){nums.sort((a,b)=>a-b);const res=[];for(let i=0;i<nums.length-2;i++){if(i>0&&nums[i]===nums[i-1])continue;let l=i+1,r=nums.length-1;while(l<r){const s=nums[i]+nums[l]+nums[r];if(s===0){res.push([nums[i],nums[l],nums[r]]);while(l<r&&nums[l]===nums[l+1])l++;while(l<r&&nums[r]===nums[r-1])r--;l++;r--;}else if(s<0)l++;else r--;}}return res;}

E3. Spiral Matrix

Solution (JS)
function spiralOrder(m){if(!m.length)return[];const r=[];let t=0,b=m.length-1,l=0,ri=m[0].length-1;while(t<=b&&l<=ri){for(let i=l;i<=ri;i++)r.push(m[t][i]);t++;for(let i=t;i<=b;i++)r.push(m[i][ri]);ri--;if(t<=b)for(let i=ri;i>=l;i--)r.push(m[b][i]);b--;if(l<=ri)for(let i=b;i>=t;i--)r.push(m[i][l]);l++;}return r;}

E4. Rotate Image 90°

Solution (JS)
function rotate(m){const n=m.length;for(let i=0;i<n;i++)for(let j=i+1;j<n;j++)[m[i][j],m[j][i]]=[m[j][i],m[i][j]];for(let i=0;i<n;i++)m[i].reverse();}

E5. Search 2D Matrix

Solution (JS)
function searchMatrix(m,t){const rows=m.length,cols=m[0].length;let lo=0,hi=rows*cols-1;while(lo<=hi){const mid=Math.floor((lo+hi)/2),v=m[Math.floor(mid/cols)][mid%cols];if(v===t)return true;v<t?lo=mid+1:hi=mid-1;}return false;}

E6. Set Matrix Zeroes (O(1) space)

E7. Subarray Sum Equals K

E8. Minimum Window Substring

E9. Maximum Sliding Window

E10. Merge Intervals

E11. Next Permutation

E12. Longest Increasing Subsequence

E13. Matrix Multiplication


Additional exercise bank

EX-014

  • Problem: Advanced array exercise #14.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-015

  • Problem: Advanced array exercise #15.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-016

  • Problem: Advanced array exercise #16.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-017

  • Problem: Advanced array exercise #17.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-018

  • Problem: Advanced array exercise #18.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-019

  • Problem: Advanced array exercise #19.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-020

  • Problem: Advanced array exercise #20.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-021

  • Problem: Advanced array exercise #21.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-022

  • Problem: Advanced array exercise #22.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-023

  • Problem: Advanced array exercise #23.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-024

  • Problem: Advanced array exercise #24.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-025

  • Problem: Advanced array exercise #25.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-026

  • Problem: Advanced array exercise #26.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-027

  • Problem: Advanced array exercise #27.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-028

  • Problem: Advanced array exercise #28.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-029

  • Problem: Advanced array exercise #29.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-030

  • Problem: Advanced array exercise #30.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-031

  • Problem: Advanced array exercise #31.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-032

  • Problem: Advanced array exercise #32.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-033

  • Problem: Advanced array exercise #33.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-034

  • Problem: Advanced array exercise #34.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-035

  • Problem: Advanced array exercise #35.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-036

  • Problem: Advanced array exercise #36.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-037

  • Problem: Advanced array exercise #37.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-038

  • Problem: Advanced array exercise #38.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-039

  • Problem: Advanced array exercise #39.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-040

  • Problem: Advanced array exercise #40.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-041

  • Problem: Advanced array exercise #41.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-042

  • Problem: Advanced array exercise #42.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-043

  • Problem: Advanced array exercise #43.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-044

  • Problem: Advanced array exercise #44.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-045

  • Problem: Advanced array exercise #45.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-046

  • Problem: Advanced array exercise #46.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-047

  • Problem: Advanced array exercise #47.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-048

  • Problem: Advanced array exercise #48.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-049

  • Problem: Advanced array exercise #49.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-050

  • Problem: Advanced array exercise #50.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-051

  • Problem: Advanced array exercise #51.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-052

  • Problem: Advanced array exercise #52.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-053

  • Problem: Advanced array exercise #53.
  • Difficulty: Easy
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-054

  • Problem: Advanced array exercise #54.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-055

  • Problem: Advanced array exercise #55.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-056

  • Problem: Advanced array exercise #56.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-057

  • Problem: Advanced array exercise #57.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-058

  • Problem: Advanced array exercise #58.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-059

  • Problem: Advanced array exercise #59.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-060

  • Problem: Advanced array exercise #60.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-061

  • Problem: Advanced array exercise #61.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-062

  • Problem: Advanced array exercise #62.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-063

  • Problem: Advanced array exercise #63.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-064

  • Problem: Advanced array exercise #64.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-065

  • Problem: Advanced array exercise #65.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-066

  • Problem: Advanced array exercise #66.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-067

  • Problem: Advanced array exercise #67.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-068

  • Problem: Advanced array exercise #68.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-069

  • Problem: Advanced array exercise #69.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-070

  • Problem: Advanced array exercise #70.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-071

  • Problem: Advanced array exercise #71.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-072

  • Problem: Advanced array exercise #72.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-073

  • Problem: Advanced array exercise #73.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-074

  • Problem: Advanced array exercise #74.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-075

  • Problem: Advanced array exercise #75.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-076

  • Problem: Advanced array exercise #76.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-077

  • Problem: Advanced array exercise #77.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-078

  • Problem: Advanced array exercise #78.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-079

  • Problem: Advanced array exercise #79.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-080

  • Problem: Advanced array exercise #80.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-081

  • Problem: Advanced array exercise #81.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-082

  • Problem: Advanced array exercise #82.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-083

  • Problem: Advanced array exercise #83.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-084

  • Problem: Advanced array exercise #84.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-085

  • Problem: Advanced array exercise #85.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-086

  • Problem: Advanced array exercise #86.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-087

  • Problem: Advanced array exercise #87.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-088

  • Problem: Advanced array exercise #88.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-089

  • Problem: Advanced array exercise #89.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-090

  • Problem: Advanced array exercise #90.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-091

  • Problem: Advanced array exercise #91.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-092

  • Problem: Advanced array exercise #92.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-093

  • Problem: Advanced array exercise #93.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-094

  • Problem: Advanced array exercise #94.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-095

  • Problem: Advanced array exercise #95.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-096

  • Problem: Advanced array exercise #96.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-097

  • Problem: Advanced array exercise #97.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-098

  • Problem: Advanced array exercise #98.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-099

  • Problem: Advanced array exercise #99.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-100

  • Problem: Advanced array exercise #100.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-101

  • Problem: Advanced array exercise #101.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-102

  • Problem: Advanced array exercise #102.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-103

  • Problem: Advanced array exercise #103.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-104

  • Problem: Advanced array exercise #104.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-105

  • Problem: Advanced array exercise #105.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-106

  • Problem: Advanced array exercise #106.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-107

  • Problem: Advanced array exercise #107.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-108

  • Problem: Advanced array exercise #108.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-109

  • Problem: Advanced array exercise #109.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-110

  • Problem: Advanced array exercise #110.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-111

  • Problem: Advanced array exercise #111.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-112

  • Problem: Advanced array exercise #112.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-113

  • Problem: Advanced array exercise #113.
  • Difficulty: Medium
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-114

  • Problem: Advanced array exercise #114.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-115

  • Problem: Advanced array exercise #115.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-116

  • Problem: Advanced array exercise #116.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-117

  • Problem: Advanced array exercise #117.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-118

  • Problem: Advanced array exercise #118.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-119

  • Problem: Advanced array exercise #119.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-120

  • Problem: Advanced array exercise #120.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-121

  • Problem: Advanced array exercise #121.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-122

  • Problem: Advanced array exercise #122.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-123

  • Problem: Advanced array exercise #123.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-124

  • Problem: Advanced array exercise #124.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-125

  • Problem: Advanced array exercise #125.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-126

  • Problem: Advanced array exercise #126.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-127

  • Problem: Advanced array exercise #127.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-128

  • Problem: Advanced array exercise #128.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-129

  • Problem: Advanced array exercise #129.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-130

  • Problem: Advanced array exercise #130.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-131

  • Problem: Advanced array exercise #131.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-132

  • Problem: Advanced array exercise #132.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-133

  • Problem: Advanced array exercise #133.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-134

  • Problem: Advanced array exercise #134.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-135

  • Problem: Advanced array exercise #135.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-136

  • Problem: Advanced array exercise #136.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-137

  • Problem: Advanced array exercise #137.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-138

  • Problem: Advanced array exercise #138.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-139

  • Problem: Advanced array exercise #139.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-140

  • Problem: Advanced array exercise #140.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-141

  • Problem: Advanced array exercise #141.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-142

  • Problem: Advanced array exercise #142.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-143

  • Problem: Advanced array exercise #143.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-144

  • Problem: Advanced array exercise #144.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-145

  • Problem: Advanced array exercise #145.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-146

  • Problem: Advanced array exercise #146.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-147

  • Problem: Advanced array exercise #147.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-148

  • Problem: Advanced array exercise #148.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-149

  • Problem: Advanced array exercise #149.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-150

  • Problem: Advanced array exercise #150.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-151

  • Problem: Advanced array exercise #151.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-152

  • Problem: Advanced array exercise #152.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-153

  • Problem: Advanced array exercise #153.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-154

  • Problem: Advanced array exercise #154.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-155

  • Problem: Advanced array exercise #155.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-156

  • Problem: Advanced array exercise #156.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-157

  • Problem: Advanced array exercise #157.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-158

  • Problem: Advanced array exercise #158.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-159

  • Problem: Advanced array exercise #159.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-160

  • Problem: Advanced array exercise #160.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-161

  • Problem: Advanced array exercise #161.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-162

  • Problem: Advanced array exercise #162.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.

EX-163

  • Problem: Advanced array exercise #163.
  • Difficulty: Hard
  • Skills: Two pointers, prefix sum, sliding window, matrix ops.
  • Implementation: Both JS and C++.