Pierre-Marie Poitevin
Pierre-Marie Poitevin

Jun 26, 2020

·
3 min read
·

Leetcode 1477: Find Two Non-overlapping Sub-arrays Each With Target Sum

In this Leetcode problem, we want to find 2 non overlapping subarray with subarray sum target, and we want to find the pair such that sum of the length of both subarrays is minimal:

Problem statement

Solution

Below is the outline of the algorithms I used, which essentially finds all the subarrays and then go through them in order…

--

--

More from Pierre-Marie Poitevin

Likes to code and to learn.

Recommended from Medium

Dominik Koszkul

Dominik Koszkul

AWS CloudFormation default values remain unchanged after update? Here’s why.

Ira Smith

Ira Smith

Why is my Amazon Alexa App not working on Android Smart Phones?

Kiprono Elijah Koech

Kiprono Elijah Koech

in

Analytics Vidhya

Creating Python Virtual Environment and how to add it to JuPyter Notebook

M.hosein abbasi

M.hosein abbasi

How to use event storming to achieve domain-driven design

Hershy Bateea

Hershy Bateea

The Sunday Solver: LRU Cache

Lukas Oldenburg

Lukas Oldenburg

Life with Adobe Launch 2/3: Make it scale with a Custom Extension

Muhammad Sarwar

Muhammad Sarwar

Control Systems: A Comprehensive Introduction — Part I

Ryan Schleck

Ryan Schleck

Data Structures, Algorithms, And Big O Notation! A Beginners Guide.

AboutHelpTermsPrivacy


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Get unlimited access
Pierre-Marie Poitevin

Pierre-Marie Poitevin

179 Followers

Likes to code and to learn.

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech