Back to Browse

Searching Algorithm - (Q&A -7) - Zero Sum Subarray Problem

179 views
Feb 24, 2022
17:28

Given an array of positive and negative numbers, find if there exist a subarray with 0 sum. (In single iteration) Input: [ 3 , 4 , - 7, 3, 1, 3, 1, -4, -2, -2 ] Output : true Explanation: The subarrays with sum zero are { 3, 4, -7 }, { 4, -7, 3} etc. ***************************** Difficulty: Medium Topic: Searching Algorithm DS: Array | HashSet Company: FAANG ***************************** This problem is very popular for any technical interview. Mostly for companies such as Microsoft, Twitter, Apple, and Amazon etc. And there are wide varieties of problems that can be asked, as an enhancement of this problem statement. Code: https://bit.ly/31y0ep8 [IMPORTANT] Complete List of interview questions that you need to prepare: https://bit.ly/34HXbMI In this video we will see, how to find if there is a subarray with 0 sum **This video comes under "MEDIUM" section of interview questions. Q1: Find duplicate element in a given array: Q2: Separate odds and even numbers in a given array: Q3: Segregate 0's 1's and 2's in an array: Q4: First occurrence of a number in a sorted array: Q5: Trapping Rain Water Problem: Q6:Smallest Missing Number in sorted array: Q7: Zero Sum Subarray Problem: Q8: Number of rotation in a circular sorted array: Q9:First non repeating character in a string: Q10: Longest Substring Without Repeating Characters: Q11: Find Triplets In Array With Given Sum: Q12: Max Contiguous Subarray Sum ( Kadane's Algo ): #interviewWithBunny #codinginterview #crackingthetechnicalinterview Social Connect: LinkedIn: https://www.linkedin.com/in/anindya-sankar-dasgupta-39a315ba/ Facebook: https://www.facebook.com/anindya.s.dasgupta Instagram: https://www.instagram.com/anindya_bunny/ Medium: https://bit.ly/3loMzsa FB page: https://www.facebook.com/technicalinterview03/ Telegram: https://t.me/TechnicalInterview_official Additional Tags: zero sum subarray problem zero sum subarray subarray with sum zero subarray sum 0 subarray with zero sum subarray sum equals 0 find subarray with zero sum zero subarray sum subarray sum problem subarray sum zero sum subarray gfg subarray with 0 sum find subarray with 0 sum subarray with zero sum leetcode subarray with sum equal to zero subarray sum zero subarray with sum k subarray with given sum 0 find if there is any subarray with sum equal to zero

Download

1 formats

Video Formats

360pmp426.2 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Searching Algorithm - (Q&A -7) - Zero Sum Subarray Problem | NatokHD