Manish Khyalia

228 posts

Manish Khyalia

Manish Khyalia

@Manish_Kumar60

Java developer | Python | DSA|Spring Boot Don’t think about being too early or too late. Just start and be consistent.

Katılım Temmuz 2025
18 Takip Edilen9 Takipçiler
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode — Binary Tree Zigzag Level Order Traversal Used BFS + Queue with a boolean flag to alternate directions each level Added values normally and reversed order using add(0, val) when needed. #LeetCode #Java #DSA #BinaryTree
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
1
11
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode — Binary Tree Preorder Traversal Used iterative DFS with Stack instead of recursion. Push right first, then left → ensures preorder (Root → Left → Right) Time: O(n) | Space: O(n) #LeetCode #Java #DSA #BinaryTree
Manish Khyalia tweet media
English
0
0
1
11
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
LeetCode 107 Binary Tree Level Order Traversal II Used BFS + Queue. Collected levels normally, then reversed the result Time: O(n) | Space: O(n) Tree pattern mastery continues #LeetCode #DSA #Java
Manish Khyalia tweet media
English
0
0
2
11
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
LeetCode 102 Binary Tree Level Order Traversal Solved using BFS + Queue. Used q.size() to process each level separately. Time: O(n) | Space: O(n) Tree patterns getting stronger #LeetCode #DSA #Java
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
2
7
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1450 — Number of Students Doing Homework at a Given Time Used simple traversal: For each student, check if queryTime lies between startTime[i] and endTime[i], then increment count. O(n) #LeetCode #DSA #Java #CodingJourney
Manish Khyalia tweet media
English
0
0
1
16
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1732 — Find the Highest Altitude Used cumulative (prefix) sum to track altitude changes. Start from 0, keep adding gain[i], and update the maximum altitude during traversal. O(n) #LeetCode #PrefixSum #DSA #Java
Manish Khyalia tweet media
English
0
0
1
7
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved a GCD + LCM based problem using the Euclidean Algorithm • Built helper functions for gcd() and lcm() • Used brute-force subarray expansion • Maintained running GCD, LCM, and product to validate condition #LeetCode #DSA #Java #CodingJourney
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
1
13
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 11 — Container With Most Water Applied the Two Pointer approach to maximize area efficiently. •Started with left & right pointers •Calculated area using min height × width •Moved the smaller height pointer to explore better possibilities #LeetCode #Java #DSA
Manish Khyalia tweet media
English
0
0
1
10
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 3005 Used a HashMap to track frequency of each number and identified the maximum frequency efficiently. • Counted occurrences using map.getOrDefault() • Tracked highest frequency while iterating •Calculated total contribution of max freq #LeetCode #Java #DSA
Manish Khyalia tweet media
English
0
0
1
11
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1662 Used StringBuilder to efficiently concatenate both string arrays and compared the final strings. ✔️ Two pointers to traverse word1 and word2 ✔️ Built strings step-by-step ✔️ Simple and clean comparison using equals() #LeetCode #Java #DSA #CodingJourney
Manish Khyalia tweet media
English
0
0
0
12
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 3713 Implemented a brute-force approach using frequency counting to check valid balanced substrings. Maintained a 26-size freq array Expanded window from every index Verified balance condition by comparing character frequencies #LeetCode #DSA #Java #CodingJourney
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
1
9
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 2981 Used a brute-force + HashMap approach to track valid substrings and their frequencies. Build substrings while maintaining the same consecutive characters Store counts using HashMap Find the maximum length whose frequency ≥ 3 #LeetCode #DSA #Java
Manish Khyalia tweet media
English
0
0
1
11
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1768 — Merge Strings Alternately Used a simple two-pointer approach with StringBuilder to efficiently merge characters from both strings one by one. Handled remaining characters after the shorter string ends #LeetCode #Java #DSA #CodingJourney #TwoPointers
Manish Khyalia tweet media
English
0
0
1
13
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode — Find Numbers with Even Number of Digits Used a simple digit-count approach by dividing numbers by 10 and checking even length. Clean logic O(n) #LeetCode #Java #DSA #CodingJourney
Manish Khyalia tweet media
English
0
0
1
9
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode — Maximum Number of Words Found in Sentences Tried two approaches: Split + length method — cleaner and faster Space counting approach — more manual logic #LeetCode #Java #DSA
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
1
8
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1652 — Defuse the Bomb Used Sliding Window + Circular Array instead of brute force to achieve O(n) time. Handled both k > 0 and k < 0 using modular indexing. (i % n + n) % n for circular traversal #LeetCode #Java #SlidingWindow #DSA
Manish Khyalia tweet mediaManish Khyalia tweet mediaManish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
0
16
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 1653 – Minimum Deletions to Make String Balanced Tried two approaches: • Stack based simulation • Greedy counting (O(n)) – track bCount & minimize deletions #LeetCode #DSA #Java #CodingJourney
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
0
8
Manish Khyalia
Manish Khyalia@Manish_Kumar60·
Solved LeetCode 2962 – Count Subarrays Where Max Element Appears at Least K Times Tried two approaches: • HashMap + Sliding Window → accepted but slower •Optimized Sliding Window with max tracking → faster and cleaner logic #LeetCode #SlidingWindow #Java #DSA #CodingJourney
Manish Khyalia tweet mediaManish Khyalia tweet media
English
0
0
2
18