🚀 Day 31 of #100DaysOfCode Solved LeetCode Problem #944 – Delete Columns to Make Sorted. A clean and straightforward problem focused on checking column-wise ordering across multiple strings. The goal was to identify and remove columns that break lexicographical order. Key Learnings: -> Iterated column by column instead of row-wise -> Detected early breaks to optimize checks -> Reinforced understanding of string indexing and comparisons -> Simple logic, but careful traversal mattered Language Used: Java -> Runtime: 7 ms (Beats 92.96%) -> Memory: 47.16 MB Consistency beats intensity. On to the next problem 💪 #LeetCode #Java #Strings #ProblemSolving #100DaysOfCode #Algorithms
LeetCode Problem #944: Delete Columns for Sorted Strings
More Relevant Posts
-
Day 29 Today’s problem: LeetCode 153 – Find Minimum in Rotated Sorted Array This problem was a great reminder of how powerful Binary Search can be when applied thoughtfully. Key Takeaways: A rotated sorted array still has structure—you just need to identify it. Comparing mid with right helps decide which half contains the minimum. Achieved O(log n) time complexity by avoiding linear scans. #DSA #Java #LeetCode #BinarySearch #ProblemSolving #CodingJourney #FindMinimuminRotatedSortedArraySoln
To view or add a comment, sign in
-
-
✨ Day 24 of #100DaysOfCode on LeetCode Today’s grind was all about deep copying a linked list with random pointers. 🔹 Problem: Copy List with Random Pointer 🔹 Language: Java 🔹 Approach: Used a HashMap to store original-to-copied node mappings, then linked next and random pointers in a second pass. 🔹 Result: ✅ Passed all 19 test cases ⚡ Runtime: 0 ms (beats 100%) 💾 Memory: 46.29 MB (beats 92.15%) This problem was a great reminder that sometimes the cleanest solution is about mapping relationships clearly rather than overcomplicating with pointer juggling.
To view or add a comment, sign in
-
-
day 93/100 #leetcodegrind “Find Minimum in a Sorted Rotated Array” problem — a classic example of Binary Search in action. 💡 Key idea: In a rotated sorted array, the minimum element is the pivot. By comparing mid and high elements, we can efficiently narrow the search space to find the minimum in O(log n) time. 🧠 What I practiced: Binary search on rotated arrays Identifying the pivot element efficiently Handling edge cases like non-rotated arrays Writing clean and optimized Java code It’s a simple problem, but it reinforces the power of binary search in non-traditional ways. Rotation? No problem! 🔄🚀 #DSA #ProblemSolving #Java #BinarySearch #Arrays #LeetCode #CodingPractice #DailyLearning
To view or add a comment, sign in
-
-
📅 Day 43 of #100DaysOfLeetCode 🧩 Problem: 944. Delete Columns to Make Sorted ⚡ Difficulty: Easy 🚀 What I learned today: Visualized the input as a grid of characters (row-wise strings, column-wise comparison) Iterated column by column and checked if characters are lexicographically sorted top to bottom As soon as a column violates sorting (strs[i][j] < strs[i-1][j]), it must be deleted Early break optimization avoids unnecessary comparisons 🧠 Approach: Loop through each column Compare adjacent rows in that column Count columns where the order is not non-decreasing ⏱️ Complexity: Time: O(n × m) Space: O(1) #LeetCode #Java #ProblemSolving #CodingChallenge #100DaysOfCode #DSA #LearningEveryday
To view or add a comment, sign in
-
-
50 lines of code vs. 1 line. Who wins? 🥊 If you’re still writing getters, setters, constructors, and toString methods manually in 2026, you are working too hard. Java Records changed the game by killing "Boilerplate Hell." It turns a massive, messy POJO into a single, elegant line of code. In my latest blog post, I break down: ✅ Why "Data as Data" is better than "Data as Behavior." ✅ The "Freebies" you get from the compiler. ✅ Real-world scenarios where Records shine. Read the full breakdown here: 👇 https://lnkd.in/gUkyPU8c #Java #CleanCode #SoftwareEngineering #BackendDevelopment #JavaRecords #ProgrammingTips
To view or add a comment, sign in
-
-
🚀 Day 41 of #100DaysOfCode Solved LeetCode Problem #840 – Magic Squares in Grid ✨🔢 This problem focused on identifying all 3×3 subgrids that form a valid magic square, where every row, column, and diagonal sums to the same value and all numbers from 1 to 9 appear exactly once. Key Learnings: -> Iterated through all possible 3×3 subgrids efficiently -> Validated uniqueness of numbers using a boolean check array -> Verified row, column, and diagonal sums against a target sum -> Reinforced careful condition checking to avoid false positives Language Used: Java -> Runtime: 0 ms (Beats 100.00%) -> Memory: 43.22 MB Precision and validation go hand in hand—small grids, strict rules, clean logic 🚀 #LeetCode #Java #BruteForce #Matrix #ProblemSolving #Algorithms #100DaysOfCode
To view or add a comment, sign in
-
-
Day 16 of my LeetCode Journey Problem: Group Anagrams Approach 1 (Primary): Used a HashMap where the key is the word’s sorted characters. All anagrams produce the same sorted string, so they naturally group together. Convert word → char array Sort lexicographically Use sorted string as key Store original words as values Why it works? Anagrams share identical sorted forms. Time Complexity: O(n * k log k) Alternative Optimization: Instead of sorting, use a character frequency array (26 letters) as the key. This avoids sorting and improves time complexity. Time Complexity: O(n * k) Key insight: Choosing the right hash key representation can significantly impact performance. On to Day 17 💪 #LeetCode #DSA #Java #ProblemSolving #Consistency #CodingJourney #1001DaysOfCode Space Complexity: O(n * k)
To view or add a comment, sign in
-
-
🚀 Day 52 of #100DaysOfCode Solved LeetCode Problem #712 – Minimum ASCII Delete Sum for Two Strings. This problem focused on minimizing the total ASCII value of deleted characters to make two strings equal. A classic dynamic programming challenge that required carefully defining states and transitions for optimal substructure. Key Learnings: -> Modeled the problem using DP on string indices -> Handled base cases when one string is fully consumed -> Used memoization to avoid overlapping subproblems Strengthened understanding of string DP and cost-based optimization Language Used: Java -> Runtime: 34 ms (Beats 7.60%) -> Memory: 50.39 MB Consistent practice, deeper DP intuition, and steady progress 🚀 #LeetCode #DynamicProgramming #Java #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 50 of #100DaysOfCode Solved LeetCode Problem #1458 – Max Dot Product of Two Subsequences ✅ This problem focused on finding the maximum dot product between non-empty subsequences of two arrays. The tricky part was handling negative values and ensuring at least one pair is always chosen. Key Learnings: -> Used Dynamic Programming with memoization to avoid recomputation -> Carefully handled the base case using Integer.MIN_VALUE to enforce non-empty subsequences -> Explored the classic include vs exclude decision at each index -> Strengthened understanding of DP on two sequences Language Used: Java -> Runtime: 11 ms (Beats 59.26%) -> Memory: 48.77 MB Step by step, sharpening DP intuition and edge-case handling 🚀 #LeetCode #DynamicProgramming #Java #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 76/100 - Problem of the day :- Delete Columns to Make Sorted 🎯 Goal Identify the minimum number of columns to delete so that each remaining column is sorted lexicographically from top to bottom. 🧠 Core Idea Traverse column by column. For each column, check whether characters are in non-decreasing order across all strings. If a column breaks the order, it must be deleted. ✨ Key Takeaway Sometimes the simplest column-wise comparison approach gives the most optimal and readable solution. Always think about breaking the problem into reusable checks. 📦 Space Complexity O(1) — No extra space used apart from variables. ⏱ Time Complexity O(n × m) n = number of strings m = length of each string #LeetCode #DSA #Java #ProblemSolving #CodingJourney #Algorithms #TechSkills #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development