Ayushi kumari’s Post

🚀 Day 54 | LeetCode Learning Journal Today I solved Range Sum Query Immutable using C++. This problem was a great introduction to optimizing repeated queries using preprocessing! 🔑 Key Points: • Used Prefix Sum Array to store cumulative sums • Precomputed values to avoid recalculating sums every time • Answered each query in O(1) time • Focused on reducing time complexity from brute force O(n) to optimal 🌱 What I Learned: • How preprocessing can drastically improve performance • Concept of prefix sums and their real-world use • Trade-off between space and time complexity • Writing cleaner and efficient query-based logic #LeetCode #100DaysOfCode #DSA #CodingJourney #CPlusPlus #Algorithms #Day54 🚀

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories