filmov
tv
Arrays Series #3- Equilibrium index of an array - Solution Explained in Java
Показать описание
Given an array A of n positive numbers. The task is to find the first Equilibium Point in the 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: Retun the index of Equilibrium point. (1-based index)
Example 1:
Input:
n = 5
A[] = {1,3,5,2,2}
Output: 3
Explanation: For second test case
equilibrium point is at position 3
as elements before it (1+3) =
elements after it (2+2).
Practice links:
---------------------------------------------------------
Please click the LIKE button so that this kind of content can be seen by as many as possible aspiring engineers and professionals. Doing so gives me even more motivation to post such content in the future.
Please comment below and let me know if you have any questions or concerns.
Additionally, don't forget to click the bell symbol to receive notifications and subscribe to the channel.
----------------------------------------------------------
Created and Instructed by:
Varsha Das
Code WIth Ease is meant to make problem-solving in programming easier. For DSA preparation, we post topic-specific videos pertaining to Coding Interview topics so that everyone may approach such questions with a clear thought process and achieve the best outcomes. In addition, we make an effort to include different "Primer Series" that teach particular concepts or algorithms. We want to be the one-stop solution for everything pertaining to DSA preparation and programming foundations in general, saving candidates from having to visit many sources in order to receive structured content.
Additionally, we believe that learning to code entails much more than only "cracking the coding interview." The long-term goal of this channel is to create more proficient problem-solvers in this field so that, in the end, we can create fantastic products and be able to resolve challenging issues in our environment to improve the quality of life for everyone.
#equilibriumindex #arraysinjava #codinginterviewquestions
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: Retun the index of Equilibrium point. (1-based index)
Example 1:
Input:
n = 5
A[] = {1,3,5,2,2}
Output: 3
Explanation: For second test case
equilibrium point is at position 3
as elements before it (1+3) =
elements after it (2+2).
Practice links:
---------------------------------------------------------
Please click the LIKE button so that this kind of content can be seen by as many as possible aspiring engineers and professionals. Doing so gives me even more motivation to post such content in the future.
Please comment below and let me know if you have any questions or concerns.
Additionally, don't forget to click the bell symbol to receive notifications and subscribe to the channel.
----------------------------------------------------------
Created and Instructed by:
Varsha Das
Code WIth Ease is meant to make problem-solving in programming easier. For DSA preparation, we post topic-specific videos pertaining to Coding Interview topics so that everyone may approach such questions with a clear thought process and achieve the best outcomes. In addition, we make an effort to include different "Primer Series" that teach particular concepts or algorithms. We want to be the one-stop solution for everything pertaining to DSA preparation and programming foundations in general, saving candidates from having to visit many sources in order to receive structured content.
Additionally, we believe that learning to code entails much more than only "cracking the coding interview." The long-term goal of this channel is to create more proficient problem-solvers in this field so that, in the end, we can create fantastic products and be able to resolve challenging issues in our environment to improve the quality of life for everyone.
#equilibriumindex #arraysinjava #codinginterviewquestions
Комментарии