#114

Sdílet
Vložit
  • čas přidán 21. 09. 2023
  • #GFG #POTD #geeksforgeeks #problemoftheday
    In this video, I will be discussing the Equilibrium Point Problem.
    👉🏻 LinkedList Playlist - • Linked List
    👉🏻 Graphs Playlist - • Graphs
    👉🏻 Tree/BST Playlist - • Binary Trees / BST
    If you are new to the channel, please like this video, comment, and subscribe ❤️
    Important Links -
    ▶️ Telegram - t.me/placementsready
    ▶️ Instagram - / placementsready
    ▶️ Twitter - / placementsr
    ▶️ LinkedIn - / placementsready
    ▶️ Problem Link - practice.geeksforgeeks.org/pr...
    ▶️ Solution Link C++ - ideone.com/8Itf97
    ▶️ Solution Link JAVA - ideone.com/UVCnYY
    ▶️ Solution Link Python - ideone.com/BxSbsG
    🔥 1:1 Mentorship - topmate.io/avinash
    equilibrium point
    equilibrium point
    equilibrium point easiest explaination
    equilibrium point c++
    equilibrium point java
    equilibrium point python
    equilibrium point explaination
    code for equilibrium point problem
    equilibrium point programming interview question
    equilibrium point amazon interview question solution
    C program for equilibrium point
    program to find equilibrium point in an array
    find the equilibrium point of an array
    subset sum
    combination sum
    subset sum leetcode
    subset sum interview bit solution c++
    data structures and algorithms
    equilibrium point problem java
    Java equilibrium point program
    equilibrium point program in Java
    find the index of equilibrium point
    how to find equilibrium point in an array
    program to find equilibrium point
    equilibrium point gfg
    equilibrium point gfg potd
    equilibrium point gfg solution
    equilibrium point explain
    equilibrium point solution c++
    equilibrium point solution Java
    equilibrium point solution python
    replace o with x
    replace O with X
    equilibrium point solution Java gfg solution
    equilibrium point solution C++ gfg problem solution
    equilibrium point c++ code
    equilibrium point java code
    equilibrium point python code
    equilibrium point c++ code
    equilibrium point java code
    equilibrium point python code
    gfg equilibrium point c++
    gfg equilibrium point java
    gfg equilibrium point python
    gfg equilibrium point
    gfg potd equilibrium point
    equilibrium point in array
    equilibrium point gfg
    equilibrium index
    equilibrium point leetcode
    array equilibrium point
    find equilibrium point of an array
    equilibrium
    equilibrium point array
    find the equilibrium point in the array
    equilibrium index in an array
    equilibrium point gfg java
    equilibrium point java
    equilibrium point geeksforgeeks
    GFG POTD 22/09/23
    equilibrium point in an array
    find equilibrium point in an array
    equilibrium index in an array
    find equilibrium point of an array
    equilibrium point in array
    find equilibrium index of an array
    how to find pivot index of an array
    how to find equilibrium point of an array
    how to find equilibrium index of an array in java
    array equilibrium point
    find the equilibrium point in the array
    how to find a point in the array where left sum is equal to right sum
    find a index in an array such that the sum of elements before it is equal to the sum of elements after it.
    running sum of 1d array
    1480 running sum of 1d array
    leetcode running sum of 1d array
    1480. running sum of 1d array
    running sum of 1d array leetcode
    running sum of 1d array solution
    leetcode 1480. running sum of 1d array
    running sum of array python
    running sum of 1d array c++
    running sum of 1d array java
    running sum of 1d array python
    running sum of one d array leetcode
    leetcode 1480 running sum of 1d array
    how to solve gfg potd
    how to solve today's gfg potd
    solve gfg potd
    gfg potd
    gfg podt
    gfg potd today solution
    potd gfg
    today gfg potd solution
    problem of the day
    gfg problem of the day
    gfg potd today
    gfg potd today solution
    problem of the day gfg
    problem of the day solution
    geeksforgeeks practice
    problem of the day gfg solution
    problem of the day 23/09/23
    geeksforgeeks potd
    gfg practice problem
    problem of the day
    gfg problem of the day
    leetcode problem of the day
    daily problem
    problem-solving classes
    problem of the day gfg
    gfg problem of days
    practice coding problems
    distinct number of balls in every bucket
    leetcode September challenge
    gfg problem
    leetcode problem
    leetcode problems
    leetcode practice problem
    how to solve the problem of the day geeks for geeks
    geeksforgeeks
    Given an array A of n positive numbers. The task is to find the first equilibrium point in an array. Equilibrium point in an array is a position such that the sum of elements before it is equal to the sum of elements after it.
    Note: Return equilibrium point in 1-based indexing. Return -1 if no such point exists.
    Connect with me on LinkedIn - / avinashkumarmallik

Komentáře • 18

  • @riyasingh6864
    @riyasingh6864 Před 10 měsíci

    Very good explaination

  • @abdullashameempullaratt
    @abdullashameempullaratt Před 9 měsíci

    At 8:25,
    Is the rightSum = totalSum - a[i] - leftSum ?

    • @PlacementsReady
      @PlacementsReady  Před 9 měsíci +1

      Yes please go through full video u will get it

    • @user-gz7yu4xq3l
      @user-gz7yu4xq3l Před měsícem

      @@PlacementsReady but it wont work it we have first position as equilibrium point for e.g: 1,0 so we need to use rightsum = totalsum - a[i], leftsum += a[i] and consdition to return is if leftsum == rightsum-a[i]

  • @farhanmuhamed392
    @farhanmuhamed392 Před 10 měsíci

    Two pointer method is more optimised, only takes O(n) time instead of O(2n)

    • @cosmosXverse
      @cosmosXverse Před 10 měsíci

      can you explain little bit...about two pointer method

    • @PlacementsReady
      @PlacementsReady  Před 10 měsíci

      @farhanmuhamed392 how are you solving this question using two pointer approach?

    • @farhanmuhamed392
      @farhanmuhamed392 Před 10 měsíci

      @@PlacementsReady
      int equilibriumPoint(long long a[], int n) {
      int left=0, right=n-1;
      long long sumLeft=a[left], sumRight=a[right];
      while(left != right){
      if(sumLeft > sumRight){
      right--;
      sumRight = sumRight + a[right];
      }
      else{
      left++;
      sumLeft = sumLeft + a[left];
      }
      }
      if( sumLeft == sumRight) return left+1;
      else return -1;
      }

    • @farhanmuhamed392
      @farhanmuhamed392 Před 10 měsíci

      @@cosmosXverse Declare 4 variables left, right, leftSum, rightSum
      left and right are pointers , and leftSum and rightSum keep track sum of value at current pointers
      int equilibriumPoint(long long a[], int n) {
      int left=0, right=n-1;
      long long sumLeft=a[left], sumRight=a[right];
      while(left != right){
      if(sumLeft > sumRight){
      right--;
      sumRight = sumRight + a[right];
      }
      else{
      left++;
      sumLeft = sumLeft + a[left];
      }
      }
      if( sumLeft == sumRight) return left+1;
      else return -1;
      }

    • @pranavmittal2976
      @pranavmittal2976 Před 10 měsíci

      @@farhanmuhamed392 bro it is failing for the test case 1 2 0 3 it expected output is 3 but it is printing -1