Find all triplets with zero sum | Explanation with Code | Competitive Programming

Sdílet
Vložit
  • čas přidán 25. 11. 2022
  • In This video Find all triplets with zero sum in Array is explained with code .
    Given an array of distinct elements. The task is to find triplets in the array whose sum is zero.
    Examples :
    Input: arr[] = {0, -1, 2, -3, 1}
    Output: (0 -1 1), (2 -3 1)
    Explanation: The triplets with zero sum are 0 + -1 + 1 = 0 and 2 + -3 + 1 = 0
    Input: arr[] = {1, -2, 1, 0, 5}
    Output: 1 -2 1
    Explanation: The triplets with zero sum is 1 + -2 + 1 = 0
    Both Brute Force approach and Two pointer approach is discussed
    #computer #computerscience #coding #programming #programmer #competitiveprogramming
    #coding #cpp #programming #array #arrays #leetcode #programmer #competitiveprogramming #competitive #code #datastructures #algorithms #algorithm #subarray #triplesum
    #subscribe #amazon #amazoninterviewpreparation #microsoft #microsoftinterview #faang #maang
    #like
    #share
    #subscribe
  • Zábava

Komentáře • 4