LeetCode 1004 – Max Consecutive Ones III
Approach:
Used Sliding Window.
Maintain a window with at most k zeroes.
Expand right..shrink left when invalid...and keep updating the max length.
Time O(n)
#LeetCode#DSA#Java#Coding#SlidingWindow
LeetCode (1901): Find Peak Element II
Approach:
Solved using brute force.
Find the maximum element in the entire matrix, store its row and column, and return it — the global maximum is always a peak.
#DSA#Java#LeetCode#Technology
LeetCode 744 – Find Smallest Letter Greater Than Target
Approach
Solved using Binary Search
Keep start and end pointers, check mid.
If letters[mid] > target, store it as answer and move left.
Else move right.
Handle wrap-around by returning letters[0]
#DSA#LeetCode#POTD#Java
Leetcode - 3Sumclosest
Approach:
Solved using sorting + two pointers
Fix one number, then move left/right based on sum vs target.
Update closest when |target - sum| is smaller than |target-closest|.
#DSA#LeetCode#Java
LeetCode - 3Sum
Approach
Sort the array
fix one number
use two pointers for the rest
If sum < 0 move left
If sum > 0 move right
Skip duplicates at every step.
#DSA#LeetCode#TwoPointers#CodingInterview#Java
LeetCode(19) Container With Most Water
Approach
1. Place two pointers at both ends
2.Calculate area = min(height) × distance
3.Update maximum area
4.Move the pointer with smaller height
5.Repeat until pointers meet
#LeetCode#DSA#Java#LearningInPublic
Date - 27/01/26
LeetCode (3650)
Directed graph with a one-time switch per node to reverse an incoming edge (cost = 2×w).
Approach.
Use Dijkstra.
Build a 2×n graph and find the minimum cost path.
#LeetCode#Graphs#Dijkstra#Java#DSA#ProblemSolving
Date 25/01/26
LeetCode 1984 | Pick k elements from an array such that the difference between the max and min is minimum.
My approach:
• Sort the array
• Use a sliding window of size k
• Difference = nums[i+k-1] - nums[i]
• Track the minimum difference
#LeetCode#DSA#Java
Date 24/0//26
Problem: Given an even-length array, pair elements such that the maximum pair sum is minimized.
Approach:
Sort the array
Use two pointers to pair smallest with largest
Track the maximum sum among all pairs
This avoids large+large pairs and minimizes the worst cas
Approach 2
Used two pointers i (start) and j (target).
Skipped _ using while loops and moved pointers forward.
• If chars don’t match → return false
• If char is L and j > i → invalid
• If char is R and i > j → invalid
Date - 23/01/2026
Solved LeetCode 2337 – Move Pieces to Obtain a String.
Approach 1.
I started with a brute-force solution that generates all valid combinations based on the rules.
It passed 15 test cases but resulted in TLE.
Date - 22/01/26
10am - 8pm Office
10pm-12Am Learning
Today, I learned how to implement JWT (JSON Web Token) authentication using the AuthenticationManager, including user authentication, token generation, and securing APIs.
You send that token with every request.
The server knows who you are because it verifies the token signature using a secret key
If the signature matches, the token is trusted.
Why use JWT?
It’s fast, secure, stateless, and perfect for scalable apps & microservices.
Date - 20/01/2026
10am–8pm office
11pm–1am learning
Today was all about JWT (JSON Web Token)
In simple words:
JWT is like a digital ID card.
Once you log in, the server gives you a token.
@SumitM_X Pojo is simple java class that used to store data
Dto is used to transfer data between the layers or between clients and server.
Entity is a java class that represent a table in a database.
Repository is used to interact with database.
Bean is object that is managed by spring