🚀 Day 56 — LeetCode Practice Today’s problem was all about careful pointer handling and avoiding boundary errors. ✅ Problem solved: Duplicate Zeros 💡 Key learnings from today: • Learned how to manage two pointers (read & write) effectively • Understood why boundary conditions are important to avoid runtime errors • Practiced handling cases where one input element produces multiple outputs • Improved debugging skills by fixing index-related mistakes ⚡ Approach used: • Used an extra array to store results • Ensured no out-of-bounds errors using proper checks • Maintained O(n) time complexity Every day I’m getting better at writing clean and error-free logic 💻✨ #Day56 #LeetCode #Java #CodingJourney #ProblemSolving #Consistency
LeetCode Day 56: Duplicate Zeros Problem Solved
More Relevant Posts
-
🚀 Day 74 — LeetCode Practice 🚀 Today’s problem: Split a String in Balanced Strings 💡 What I learned today: • Understood the concept of balanced strings (equal number of 'L' and 'R') • Learned how to use a counter approach instead of extra space • Practiced greedy logic to split the string at the right moment • Improved my ability to track conditions while iterating through strings 🧠 Key Idea: Maintain a counter → Increment for 'L' Decrement for 'R' Whenever the counter becomes 0, we found a balanced substring ✅ 🔥 Takeaway: Simple logic + careful observation = efficient solution Consistency is the real game changer 💯 #Day74 #LeetCode #DSA #Java #CodingJourney #Consistency #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 28/100 – #100DaysOfCode Today’s problem: Reverse Linked List (LeetCode 206) 💡 What I learned: How to reverse a singly linked list using an iterative approach Managing pointers efficiently (prev, curr, next) Understanding how links change direction step by step 🧠 Key Idea: Instead of creating a new list, we reverse the links in-place: Store next node Reverse current pointer Move forward 📊 Complexity: Time: O(n) Space: O(1) Staying consistent, one problem at a time... #Day28 #100DaysOfCode #LeetCode #DSA #LinkedList #Java #CodingJourney #ProblemSolving #TechSkills
To view or add a comment, sign in
-
-
Day 31/50 🚀 — Reverse Vowels of a String (LeetCode 345) Today’s problem was a great reminder that sometimes the simplest approaches are the most efficient. 🔹 Used the two-pointer technique 🔹 Focused on in-place swapping 🔹 Optimized for both time (O(n)) and space (O(1)) Key takeaway: Instead of overthinking, break the problem into smaller checks—identify vowels, move pointers smartly, and swap only when needed. Clean and efficient 💡 Happy to see this solution performing well: ⚡ Runtime: 2 ms (faster than 99%+) 📦 Space: Decent optimization #Day31 #LeetCode #DSA #Java #CodingJourney #50DaysOfCode #ProblemSolving #SoftwareEngineering
To view or add a comment, sign in
-
-
100 Days of Code Day - 24 🔁 Swap Nodes in Pairs – LeetCode Problem Solved a classic Linked List problem today! 💡 👉 Given a linked list, swap every two adjacent nodes without modifying values — only changing the links. ✅ Example: Input: [1,2,3,4] Output: [2,1,4,3] 💭 Approach: Used a dummy node and pointer manipulation to efficiently swap nodes in O(n) time and O(1) space. 📌 Key Learning: Understanding pointer handling is crucial for mastering Linked Lists. #LeetCode #Java #DSA #LinkedList #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day #97/100 – LeetCode Challenge 𝐓𝐨𝐝𝐚𝐲’𝐬 𝐩𝐫𝐨𝐛𝐥𝐞𝐦: 𝐂𝐨𝐦𝐛𝐢𝐧𝐚𝐭𝐢𝐨𝐧 𝐒𝐮𝐦 🔹 Problem Summary: Given an array of distinct integers and a target, find all unique combinations where the numbers sum up to the target. Each number can be used multiple times. 🔹𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡 𝐔𝐬𝐞𝐝: I solved this using Backtracking (Recursion). . Try including the current element . Explore further combinations . Backtrack and try excluding it . Stop when sum exceeds target 🔹 Key Learning: Backtracking helps in exploring all possible combinations efficiently by building solutions step-by-step and undoing choices when needed. #Day97 #100DaysOfCode #LeetCode #Java #DSA #Backtracking #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 28/50 — LeetCode #1768: Merge Strings Alternately Another day, another clean problem solved ✅ 💡 Approach: Used a single pointer to traverse both strings and alternately append characters. If one string is longer, just continue with the remaining characters. 🔧 Highlights: Used StringBuilder for efficient string manipulation Simple loop with boundary checks No extra complexity — just clean logic ⚡ Complexity: Time: O(n + m) Space: O(n + m) 📌 Takeaway: Problems like this remind me that clarity beats over-engineering. The simplest approach is often the best one. Consistency is the real win here — showing up every day and improving bit by bit. #Day28 #LeetCode #Java #DSA #CodingJourney #50DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 27/100 Days of Code Challenge Today’s problem: Find Peak Element (Leetcode 162) 🔍 What I learned: How to find a peak element efficiently without scanning the entire array Using Binary Search to reduce time complexity from O(n) to O(log n) Understanding how the “slope” of elements helps decide the search direction 🧠 Key Idea: Instead of checking every element, compare the middle element with its neighbor: If nums[mid] < nums[mid + 1] → move right Else → move left ✅ Example: Input: [1, 2, 3, 1] Output: 2 (index of peak element 3) Consistency is key 🔑 — improving problem-solving skills one day at a time! 💪 #Day27 #100DaysOfCode #LeetCode #BinarySearch #DSA #Java #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 64 — LeetCode Practice 🚀 ✅ Problem Solved: Create Target Array in the Given Order 💡 What I learned today: • Understood how insertion at a specific index works in arrays • Learned the concept of shifting elements to the right • Practiced handling multiple insert operations step-by-step • Improved clarity on array manipulation and indexing 📊 Approach: • Traverse both nums and index arrays • For each element, shift elements to the right • Insert the number at the given index • Repeat until the array is formed ⏱ Time Complexity: O(n²) 📦 Space Complexity: O(n) Simple problem, but helped me understand how arrays work internally during insert operations 💪✨ #Day64 #LeetCode #DSA #Java #LeetCodePractice #Consistency
To view or add a comment, sign in
-
-
🚀 Day 17 of My LeetCode Journey 📌 Solved: LeetCode #11 – Container With Most Water Today’s problem was a great example of applying the Two Pointer Approach efficiently. 🔍 Problem Summary: Given an array of heights, find two lines that together with the x-axis form a container that holds the maximum amount of water. 💡 Approach Used: Started with two pointers at both ends Calculated area using: min(height[left], height[right]) × width Moved the pointer with smaller height to maximize area ⚡ Key Learning: Instead of checking all pairs (O(n²)), we can optimize to O(n) using the two-pointer technique. 🧠 Time Complexity: O(n) 📦 Space Complexity: O(1) 🔥 Consistency is the key — learning something new every day! #LeetCode #DSA #Java #CodingJourney #ProblemSolving #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 29/100 – #100DaysOfCode Today’s problem: Middle of the Linked List (LeetCode 876) 🎯 💡 What I learned: How to find the middle node efficiently using the two-pointer (slow & fast) approach Understanding why the fast pointer moves twice as fast as the slow pointer Handling both odd and even length linked lists Writing optimal code with O(n) time and O(1) space 🧠 Key Idea: Use two pointers: slow → moves 1 step at a time fast → moves 2 steps at a time 👉 When fast reaches the end, slow will be at the middle! 📊 Complexity: Time: O(n) Space: O(1) 📈 One step closer to mastering Linked Lists..... #Day29 #100DaysOfCode #LeetCode #LinkedList #DSA #Java #CodingJourney #ProblemSolving #TechSkills
To view or add a comment, sign in
-
Explore related topics
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