Day 93 of #100DaysOfCode 💻 📌 LeetCode Problem 661 – Image Smoother Today’s challenge was about matrix traversal and boundary handling. 🔹 The task is to smooth an image by replacing each cell with the average of itself and its surrounding neighbors (up to 8), considering only valid indices. 🔹 Key takeaways: Careful handling of edge and corner cases Efficient use of nested loops Understanding 2D array manipulation in Java 🔹 Approach used: Iterate through each cell Check all valid neighboring cells within a 3×3 grid Compute the average using floor division 📚 Language: Java 🧠 Concepts: Arrays, Matrix traversal, Boundary conditions Consistency over intensity — 93 days done, 7 more to go! 🔥 #Day93 #LeetCode #Java #DSA #CodingChallenge #100DaysChallenge #KeepLearning
LeetCode 661: Image Smoother Java Solution
More Relevant Posts
-
Day 93 of #100DaysOfCode 💻 📌 LeetCode Problem 661 – Image Smoother Today’s challenge was about matrix traversal and boundary handling. 🔹 The task is to smooth an image by replacing each cell with the average of itself and its surrounding neighbors (up to 8), considering only valid indices. 🔹 Key takeaways: Careful handling of edge and corner cases Efficient use of nested loops Understanding 2D array manipulation in Java 🔹 Approach used: Iterate through each cell Check all valid neighboring cells within a 3×3 grid Compute the average using floor division 📚 Language: Java 🧠 Concepts: Arrays, Matrix traversal, Boundary conditions Consistency over intensity — 93 days done, 7 more to go! 🔥 #Day93 #LeetCode #Java #DSA #CodingChallenge #100DaysChallenge #KeepLearning
To view or add a comment, sign in
-
-
Day 38 — DSA | Linked List Cycle Detection (LeetCode 141) Today I worked on detecting a cycle in a linked list using Floyd’s Tortoise and Hare algorithm. Instead of extra memory, the idea is simple: Use two pointers Move one step vs two steps If they ever meet → cycle exists Why this problem matters: Tests pointer manipulation Reinforces thinking in O(n) time & O(1) space Very common in interviews to check fundamentals I also implemented a user-input version in Java to understand how cycles are actually formed, not just detected. Small problem, but strong concept. Consistency > complexity. #DSA #Day38 #LinkedList #Java #ProblemSolving #LeetCode #CodingJourney #FloydsAlgorithm #LearnByDoing #DataStructureAndAlgorithm
To view or add a comment, sign in
-
-
🚀 Day 77 of LeetCode Challenge ✅ Problem: Add Strings 🔗 https://lnkd.in/gZatGJzA 💡 Approach: Traverse both strings from right to left Convert characters to digits and add them with a carry Append the result digit-by-digit using StringBuilder Reverse the final string to get the correct sum ⚡ Performance: ✅ All test cases passed ⏱ Runtime: 2 ms (Beats 91.47%) 💾 Memory efficient and clean implementation 📚 Key Learning: When direct numeric conversion isn’t allowed, manual digit-by-digit addition is a reliable and efficient strategy for handling large numbers stored as strings. 🔧 Language: Java 📈 Consistency over intensity—one problem at a time. #LeetCode #DSA #Java #StringManipulation #MathProblems #DailyCoding #Consistency #Day77
To view or add a comment, sign in
-
-
Day 97 of #100DaysOfCode 💻 📌 LeetCode Problem 482 – License Key Formatting Today’s problem focused on string manipulation and formatting logic. 🔹 The task: Reformat a license key string so that: All letters are uppercase Groups are separated by - Each group has exactly k characters, except possibly the first 🔹 What I practiced: Traversing strings from the end Using StringBuilder efficiently Handling edge cases like trailing dashes and mixed characters 🔹 Approach: Remove all existing dashes Convert letters to uppercase Build new groups from the end and reverse the result 📚 Language: Java 🧠 Concepts: Strings, StringBuilder, Edge Cases, Formatting 97 days down — almost at the finish line! 💪🔥 #Day97 #LeetCode #Java #DSA #100DaysChallenge #StringManipulation #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day 97 of #100DaysOfCode 💻 📌 LeetCode Problem 482 – License Key Formatting Today’s problem focused on string manipulation and formatting logic. 🔹 The task: Reformat a license key string so that: All letters are uppercase Groups are separated by - Each group has exactly k characters, except possibly the first 🔹 What I practiced: Traversing strings from the end Using StringBuilder efficiently Handling edge cases like trailing dashes and mixed characters 🔹 Approach: Remove all existing dashes Convert letters to uppercase Build new groups from the end and reverse the result 📚 Language: Java 🧠 Concepts: Strings, StringBuilder, Edge Cases, Formatting 97 days down — almost at the finish line! 💪🔥 #Day97 #LeetCode #Java #DSA #100DaysChallenge #StringManipulation #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day 94 of #100DaysOfCode 💻 📌 LeetCode Problem 500 – Keyboard Row Today’s problem was a fun string-based challenge that tested character mapping and validation logic. 🔹 The task is to find words that can be typed using letters from only one row of the keyboard. 🔹 Key learnings: Efficient string traversal Comparing characters against predefined sets Writing clean conditional logic in Java 🔹 Approach: Define all three keyboard rows Convert words to lowercase Check if every character belongs to the same row 📚 Language: Java 🧠 Concepts: Strings, Arrays, Conditional Logic 94 days in, discipline still strong — onward to Day 95! 💪🔥 #Day94 #LeetCode #Java #DSA #100DaysChallenge #CodingPractice #KeepGoing
To view or add a comment, sign in
-
-
Day 94 of #100DaysOfCode 💻 📌 LeetCode Problem 500 – Keyboard Row Today’s problem was a fun string-based challenge that tested character mapping and validation logic. 🔹 The task is to find words that can be typed using letters from only one row of the keyboard. 🔹 Key learnings: Efficient string traversal Comparing characters against predefined sets Writing clean conditional logic in Java 🔹 Approach: Define all three keyboard rows Convert words to lowercase Check if every character belongs to the same row 📚 Language: Java 🧠 Concepts: Strings, Arrays, Conditional Logic 94 days in, discipline still strong — onward to Day 95! 💪🔥 #Day94 #LeetCode #Java #DSA #100DaysChallenge #CodingPractice #KeepGoing
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 62 of Daily LeetCode Practice Today’s focus: LeetCode Daily Question – “Maximum Number of Events That Can Be Attended II” 🧩 Solved it using an optimized approach in Java, combining: 📊 Sorting 🔍 Binary Search 🧠 Prefix Maximum DP ✨ Key Idea: Sort events by start time, maintain another array sorted by end time, and use a prefix max array to efficiently choose at most two non-overlapping events with maximum total value. ⚡ Performance Highlights: 🏎 Runtime: 37 ms (Beats 98%) 💾 Memory: 176.97 MB ✅ All test cases passed 💻 Language: Java This problem was a great reminder that clean preprocessing + smart searching can drastically improve performance. Consistency continues. Onward to Day 63 🚀 #Day60 #LeetCode #Java #DSA #ProblemSolving #DynamicProgramming #BinarySearch #CodingJourney #Consistency #SoftwareEngineering
To view or add a comment, sign in
-
-
📅 Day 41 of #100DaysOfLeetCode 🧩 Problem: 300. Longest Increasing Subsequence Difficulty: Medium 🚀 What I learned today: Used the Patience Sorting technique to solve LIS in O(n log n) time Maintained an auxiliary array where each index represents the minimum possible tail of an increasing subsequence of that length Applied binary search (lower bound / ceil) to efficiently replace elements Important insight: Using >= ensures the subsequence remains strictly increasing 🧠 Key Takeaway: Even though the auxiliary array doesn’t store the actual subsequence, its length always equals the LIS length — a powerful optimization over the classic DP O(n²) approach. 💡 Complexity: Time: O(n log n) Space: O(n) #LeetCode #Java #ProblemSolving #CodingChallenge #100DaysOfCode #DSA #LearningEveryday
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