Day 8 | LeetCode Learning Journal 🚀 Today I solved Fibonacci Number (Problem 509) on LeetCode. This was a simple recursion problem, but it helped me clearly understand how recursive calls build on smaller subproblems. 🔑 Key Points: • Base case: if n ≤ 1 → return n • Recursive relation: F(n) = F(n-1) + F(n-2) • Each call breaks the problem into smaller Fibonacci numbers • Basic example of recursion with a clear recurrence relation • Optimized approach can be done using iteration (DP) 🌱 What I Learned: • Importance of defining correct base conditions • How recursion tree grows exponentially • Why simple recursion can be inefficient • Difference between brute-force recursion and optimized solution • Strengthened fundamentals of recursion before moving to complex backtracking problems #LeetCode #100DaysOfCode #Recursion #DSA #Day8 🚀
Ayushi kumari’s Post
More Relevant Posts
-
🚀 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 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 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
-
-
Day-29 LeetCode Insight: Small Pattern, Big Clarity! Today I solved a simple yet tricky problem: 👉 Check if two strings can be made equal using specific swaps At first glance, it feels like a brute-force problem… but the real trick is pattern recognition 🔍 🧠 Key Learning: Instead of trying all swaps, break the string into: Even indices → (0, 2) Odd indices → (1, 3) Now the problem becomes: ✔ Can even positions match (with or without swap)? ✔ Can odd positions match (with or without swap)? That’s it. Clean. Logical. Efficient. ⚡ Best Approach: Sort both groups and compare: Even group of s1 == Even group of s2 Odd group of s1 == Odd group of s2 🚀 Takeaway: Sometimes the solution isn’t about doing more… it’s about seeing the structure hidden in the problem. #LeetCode #DSA #ProblemSolving #CodingJourney #Cpp #TechLearning
To view or add a comment, sign in
-
-
Day 16 | LeetCode Learning Journal 🚀 Today I solved Binary Tree Right Side View . This problem helped me understand how to identify the nodes visible when looking at a binary tree from the right side. 🔑 Key Points: • Uses Breadth-First Search (BFS) with a queue. • Traverse the binary tree level by level. • At each level, capture the last node visited. • The last node of every level represents the right side view. • Continue until all levels of the tree are processed. 🌱 What I Learned: • How to apply level order traversal in binary trees • Identifying the rightmost node at each level • Better understanding of queue-based traversal • Strengthened my binary tree traversal concepts • Improved problem-solving skills in tree-based problems #LeetCode #100DaysOfCode #DSA #BinaryTree #BFS #RightSideView #Day16 🚀
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 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 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 14 | LeetCode Learning Journal 🚀 Today I solved Binary Tree Zigzag Level Order Traversal (LeetCode 103). This problem helped me understand how to traverse a binary tree level by level while alternating the order of traversal at each level. 🔑 Key Points: • Uses Breadth-First Search (BFS) with a queue • Traverse the tree level by level • Alternate the traversal direction at each level (left → right, then right → left) • Store node values accordingly to achieve the zigzag pattern • Continue until all levels of the tree are processed 🌱 What I Learned: • How level order traversal works in binary trees • Implementing zigzag traversal using BFS • Managing traversal direction using a boolean flag • Improved understanding of queue-based tree traversal • Strengthened my binary tree problem-solving skills #LeetCode #100DaysOfCode #DSA #BinaryTree #BFS #ZigzagTraversal #Day14 🚀
To view or add a comment, sign in
-
-
🚀 Day 20/100 – LeetCode Challenge ✅ Problem Solved: Single Number II Today’s problem pushed me to think beyond basic approaches and dive deeper into bit manipulation. The challenge was to find the element that appears only once while every other element appears three times. Instead of using extra memory, I used a clever bitwise technique to track counts using two variables. This approach efficiently filters out elements appearing three times and keeps only the unique one. 💡 Key Learning: Bit manipulation can replace counting mechanisms Tracking states using bits is a powerful technique Optimized solutions often avoid extra space completely ⚡ Complexity: Time: O(n) Space: O(1) Day by day, building stronger problem-solving skills and consistency 💪 #Day20 #100DaysOfCode #LeetCode #DSA #Cpp #CodingJourney #ProblemSolving #BitManipulation
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