To Find the Total SubArray Sum:
4 ways ⚡️
1.)Brute force (3 loops) → O(N³)
2.)Prefix sum (2 loops) → O(N²)
3.)Carry Forward (2 loops) → O(N²)
Then comes the Devil 👹:
4) Contribution technique (element contribution in subarrays) → O(N) 🚀
#DSA#LearnInPublic
💡 Rule of thumb:
If you see i++ and a power in the condition → root-based complexity.
If you see i *= constant or i /= constant → logarithmic complexity.
#dsa#CodingJourney#codingcommunity#CodingChallenge
In a fixed-size, contiguous array, what’s the time complexity for inserting OR deleting an element at the beginning? 🤔
A) 🟢 O(1) — Constant
B) 🔵 O(n) — Linear
C) 🟡 O(log n) — Log
D) 🔴 O(n²) — Quad
💡 Hint: Think about what happens to the rest of the elements!
comment 👇
12 Followers 627 FollowingMega millions jackpot winner, I’m Michael J, Weirsky ,winner of $273,000,000 giving away $50,000 to my first 2k followers for better living be a winner 💰
197 Followers 215 FollowingAI & Automation Expert | Full Stack Dev | Future 100xdev
~
🔥 From Comfort to Conquer: My Growth Zone Journey: Mission: : $120k Remote.
641K Followers 164 FollowingHistorian and bestselling author of 'Sapiens', 'Homo Deus', '21 Lessons for the 21st Century', 'Nexus', 'Unstoppable Us' and 'Sapiens: A Graphic History'.
7K Followers 34 FollowingThe premiere developer institute, innovation lab, research hub, talent source, dev shop on @solana The Solana Talent Engine. Visit at https://t.co/VI3RQ8R0CO
35K Followers 473 FollowingBootstrapped @ScrapingBee to $5m ARR+ with a team of 6.
Exited for 8 figures.
Sharing my learnings about growth, SEO & tech.
And some dumb jokes.
55K Followers 1K FollowingInfra girlie | OSS × LLMs × Agent infra | Making APIs softer & devtools that feel like home | I stay in my lane and wish good for everyone ✨
258K Followers 274 FollowingBuilding the People-Backed Internet by turning everyday devices into verifiers fueling a trust-native web. Foundation: @layeredgefndn
1K Followers 671 Followingdevrel https://t.co/IkF2PFoX68 (@graphitenetwork) | building @abokixyz // prev BD //tweets values and code in web3// learning data in web3