๐ ๐๐ก๐ซ๐ข๐ฅ๐ฅ๐๐ ๐ญ๐จ ๐๐ก๐๐ซ๐ ๐๐ฒ ๐๐๐ซ๐๐จ๐ซ๐ฆ๐๐ง๐๐ ๐ข๐ง ๐๐จ๐๐๐ฒโ๐ฌ ๐๐๐๐ญ๐๐จ๐๐ ๐๐๐๐ค๐ฅ๐ฒ ๐๐จ๐ง๐ญ๐๐ฌ๐ญ! ๐
Happy to announce that I ๐ฌ๐จ๐ฅ๐ฏ๐๐ ๐๐ฅ๐ฅ 4 ๐ฉ๐ซ๐จ๐๐ฅ๐๐ฆ๐ฌ and secured an ๐๐ฅ๐ฅ ๐๐ง๐๐ข๐ ๐๐๐ง๐ค (๐๐๐) 1436 in todayโs ๐๐๐๐ญ๐๐จ๐๐ ๐๐๐๐ค๐ฅ๐ฒ ๐๐จ๐ง๐ญ๐๐ฌ๐ญ! ๐ช๐ฅ
Hereโs a quick snapshot of my approach to each problem:
๐น Q1: Absolute Difference Between Maximum and Minimum K Elements
Sorted the array and calculated the sum of the smallest k and largest k elements. The absolute difference gives the answer
๐น Q2: Reverse Words With Same Vowel Count
Counted vowels in the first word as a reference. For every subsequent word with the same vowel count, reversed it using StringBuilder.
๐น Q3: Minimum Moves to Balance Circular Array
First validated feasibility by checking if total positives can offset negatives. Then applied a greedy two-pointer expansion from the negative index, pulling values from nearest positive neighbors in both directions. Using closer elements first minimizes the total movement cost.
๐น Q4: Minimum Deletions to Make Alternating Substring
Handled dynamic updates and range queries using a Segment Tree. Each segment stores boundary characters and the longest alternating length.
For queries, the minimum deletions are computed as: substring length โ longest alternating length.
This contest was a great test of greedy thinking, string manipulation, and advanced data structures like Segment Trees. Consistency really pays off!
On to the next challenge ๐ป๐ฅ
#LeetCode #AIR1436 #CompetitiveProgramming #DSA #ProblemSolving #CodingContest #Java #ConsistencyWins