Day 6 | LeetCode Learning Journal 🚀 Today I solved Palindrome Partitioning (Problem 131) on LeetCode. This problem was another strong backtracking challenge, but instead of focusing on sums or combinations, it focused on dividing a string into all possible palindromic partitions. The main challenge was checking palindromes efficiently while exploring every possible cut in the string. 🔑 Key Points: • Use backtracking to try every possible substring • Check if substring is palindrome before choosing it • If valid → push → recurse → pop • Base case when start index reaches string length • Carefully manage substring ranges (start to end) 🌱 What I Learned: • How to generate all possible partitions of a string • Combining recursion with condition checking (palindrome validation) • Difference between combination-style problems and partition-style problems • How recursion explores a decision tree of “cut” vs “don’t cut” • Strengthened understanding of backtracking patterns This problem really improved my clarity on how recursive partitioning works compared to problems like Combination Sum. The structure is similar, but the condition check (palindrome) changes the whole recursion flow. #LeetCode #100DaysOfCode #Backtracking #DSA #Day5 🚀
Palindrome Partitioning LeetCode Challenge
More Relevant Posts
-
Day 10 | LeetCode Learning Journal 🚀 Today I practiced Binary Tree Preorder Traversal (Problem 144) on LeetCode. This problem helped me understand how tree traversal works when we visit the root before its subtrees. 🔑 Key Points: • Traversal order: Root → Left → Right • Visit the current node first • Recursively traverse the left subtree • Then recursively traverse the right subtree • Can also be implemented using a stack (iterative approach) 🌱 What I Learned: • Basics of tree traversal techniques • How recursion naturally fits tree structures • Difference between recursive and iterative traversal • Importance of traversal order in trees • Strengthened understanding of tree fundamentals #LeetCode #100DaysOfCode #DSA #BinaryTree #PreorderTraversal #Day10
To view or add a comment, sign in
-
-
Day 11 | LeetCode Learning Journal 🚀 Today I practiced Binary Tree Postorder Traversal (Problem 145) on LeetCode. This traversal visits the root after processing both subtrees, which makes it useful for problems like deleting trees or evaluating expressions. 🔑 Key Points: • Traversal order: Left → Right → Root • Traverse the left subtree first • Then traverse the right subtree • Visit the root node at the end • Can be implemented using recursion or stacks 🌱 What I Learned: • How postorder traversal processes children before the parent • Why this traversal is useful in tree deletion and evaluation problems • Differences between preorder, inorder, and postorder traversals • Strengthened understanding of recursive tree algorithms • Built a stronger foundation for advanced tree problems #LeetCode #100DaysOfCode #DSA #BinaryTree #PostorderTraversal #Day11
To view or add a comment, sign in
-
-
🚀 Day 4/100 — LeetCode Challenge Today I practiced problems based on the Two Pointer technique, a powerful approach for solving array and string problems efficiently. Problems solved: • Valid Palindrome • Two Sum II (Input Array Is Sorted) 🧠 Concept: Two pointers starting from different ends of the array/string and moving toward each other. 💡 Key Learning: Two pointer techniques often help eliminate nested loops and reduce time complexity to O(n). 📂 Solutions Repository https://lnkd.in/gkFh2mPZ Understanding these patterns is helping me recognize more efficient ways to approach problems. #100DaysOfLeetCode #DSA #LeetCode #CodingChallenge #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Day 20 | 100 Days of Coding Challenge #DrGViswanathanChallenge 📘 Problem Solved: Letter Combinations of a Phone Number 🔧 Approach Used (Backtracking): • Used a hash map to store the mapping of digits (2–9) to their corresponding letters (like a phone keypad). • Started from the first digit and recursively generated combinations. • For each digit, tried all possible letters mapped to it. • Used backtracking (Choose → Explore → Undo) to build all valid strings. 📌 Algorithm Steps: Create a mapping of digits to letters. Traverse the input digits one by one. For each digit, append each possible letter to the current string. Move to the next digit recursively. When the string length equals the digits length, store the combination. ⏳ Complexity: Time: O(4ⁿ) (each digit can map to up to 4 letters) Space: O(n) recursion stack 🧠 Key Learning: Backtracking is ideal for problems where we need to generate all possible combinations. The Do → Recurse → Undo pattern helps systematically explore every possibility. 📂 Topics Covered: Backtracking, Recursion, Hash Map, String Combinations #100DaysOfCode #DSA #LeetCode #CPP #CodingJourney #Backtracking #CompetitiveProgramming
To view or add a comment, sign in
-
-
Day 23 | LeetCode Learning Journal 🚀 Today I solved Binary Tree Tilt.This problem helped me understand how to combine tree traversal with calculations at each node! 🔑 Key Points: • Used postorder traversal to calculate subtree sums. • Calculated tilt as the absolute difference of left and right subtree sums. • Accumulated tilt for every node in the tree. • Focused on returning subtree sums while updating the result. • Efficient single traversal solution. 🌱 What I Learned: • How to compute values while traversing a tree. • Importance of postorder traversal in such problems. • Better understanding of recursion with return values. • Improved handling of tree-based calculations. #LeetCode #100DaysOfCode #DSA #CodingJourney #BinaryTree #Day23 🚀
To view or add a comment, sign in
-
-
🚀 Day 16/100 — LeetCode Challenge (Revision Day) Today I focused on revising core problems from Arrays and Two Pointer techniques. Revisited: • Two Sum • Two Sum II • Container With Most Water 🧠 Key Learning: Revision helps reinforce patterns and improves problem-solving speed and confidence. Sometimes going back is the best way to move forward. 📂 Solutions Repository https://lnkd.in/gkFh2mPZ #100DaysOfLeetCode #DSA #LeetCode #CodingChallenge #Revision
To view or add a comment, sign in
-
Day 37 : Practicing Backtracking on LeetCode 💡 Today’s live practical session in Alpha Plus 7.0 was all about execution. We took the theory of Backtracking and applied it directly to solve problems on LeetCode. Today’s Checklist: ✅ Backtracking Execution: Reinforced the core logic of exploring all possible combinations and retreating when necessary. ✅ Phone Keypad Problem: Successfully solved the classic "Letter Combinations of a Phone Number" problem on LeetCode. ✅ Mapping Logic: Mastered how to map numeric digits to character arrays and recursively generate every single valid string combination. #Backtracking #LeetCode #DSA #Algorithms #SoftwareEngineering #100DaysOfCode #ApnaCollege
To view or add a comment, sign in
-
-
🚀 Day 18/50 – LeetCode Challenge 🧩 Problem #108 – Convert Sorted Array to Binary Search Tree Today’s problem focused on building a height-balanced Binary Search Tree (BST) from a sorted array — a great mix of recursion and tree concepts. 📌 Problem Summary: Given a sorted array, convert it into a height-balanced BST. A BST is height-balanced if the depth of the two subtrees of every node never differs by more than one. 🔍 Approach Used ✔ Used a divide and conquer strategy ✔ Selected the middle element of the array as the root ✔ Recursively built the left subtree from the left half ✔ Recursively built the right subtree from the right half This ensures the tree remains balanced. ⏱ Time Complexity: O(n) 📦 Space Complexity: O(log n) (recursion stack) 💡 Key Learning ✔ Understanding tree construction from arrays ✔ Applying recursion effectively ✔ Importance of choosing the middle element for balance ✔ Strengthening concepts of BST and divide & conquer This problem helped reinforce how recursive thinking can simplify complex tree-building problems. Consistency is the key to mastery 🚀 🔗 Problem Link: https://lnkd.in/gymByPPA #50DaysOfLeetCode #LeetCode #DSA #BinarySearchTree #Recursion #ProblemSolving #CodingJourney #FutureAIEngineer #Consistency
To view or add a comment, sign in
-
-
24 of #100DaysOfCode 💻 Solved LeetCode 430 Flatten a Multilevel Doubly Linked List using recursion. 🔹 Key Learning: Recursion helps simplify complex hierarchical structures like multilevel linked lists by breaking them into smaller subproblems. 🔹 Approach: Traverse list node by node If child exists → recursively flatten Attach child list in between Maintain prev and next pointers carefully #DSA #Recursion #LinkedList #CodingJourney #LeetCode #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 62 of #100DaysOfCode 💻 Solved: Third Maximum Number (LeetCode 414) 🔍 Problem Statement: Given an integer array, return the third distinct maximum number. If it doesn’t exist, return the maximum number instead. 💡 Approach: The key here is “distinct” values — duplicates don’t count. First, focus on identifying unique numbers Then track the top 3 maximum distinct values If less than 3 distinct values exist → simply return the largest Instead of sorting (which adds extra cost), we can efficiently keep track of the top 3 values while traversing the array once. ⚡ Time Complexity: O(n) ⚡ Space Complexity: O(1) (if done optimally) 📌 Key Learning: This problem teaches how to optimize by avoiding sorting and how to maintain multiple maximums efficiently in a single pass. #Day62 #LeetCode #DSA #CodingJourney #PlacementPrep
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
Freshers Alert 🚀 Get daily job openings & company hiring updates. Join Infovix Official WhatsApp Channel:https://whatsapp.com/channel/0029Vb7MSYn7tkj1BLbqSX2P