Equilibrium Index in Array | Java DSA Challenge

🚀 100 Days of DSA with Java | Day 5 Q7 🚀 📌 Problem of the Day: Equilibrium Index in an Array You are given an array Arr of N integers. Your task is to find the equilibrium index. 🔹 An index is called an equilibrium index if: 👉 Sum of elements on the left side = Sum of elements on the right side 👉 The element at the index itself is not included in either sum 📝 Important Rules: Array follows 0-based indexing If multiple equilibrium indices exist, return the left-most one If no equilibrium index is found, return -1 📊 Example: Arr = [1, 7, 3, 6, 5, 6] ✅ Output: 3 (Left sum = 1 + 7 + 3 = 11, Right sum = 5 + 6 = 11) 🎯 What I practiced today: Prefix sum optimization Reducing time complexity from O(N²) to O(N) Stronger understanding of array traversal logic 💡 Problems like this build a solid foundation for advanced DSA topics. 📅 Onward to the next challenge tomorrow! #100DaysOfDSA #DSAWithJava #ArrayProblems #ProblemSolving #CodingJourney #LearningInPublic #Consistency #JavaProgramming

  • graphical user interface, text

To view or add a comment, sign in

Explore content categories