Day 14 of #100DaysOfLeetCode Problem: 136. Single Number Category: Arrays / Bit Manipulation / Hashing Today’s problem was about finding the element that appears only once in an array where every other element appears twice. It’s a great problem to strengthen both logical thinking and pattern recognition in data structures. 🧠 Key Learnings: Used frequency counting to identify the unique element among duplicates. Reinforced the idea that there’s always more than one way to solve a problem — from counting occurrences to using bitwise XOR. Improved understanding of how space and time trade-offs play a big role in algorithm design. Built confidence in working with array traversal and element comparisons. 🎯 Takeaway: Even simple problems can reveal deep insights into efficiency — sometimes the cleanest logic leads to the most optimal solution. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Arrays #Python #AIEngineer #Consistency
Solved #136 Single Number with frequency counting and XOR in #100DaysOfLeetCode
More Relevant Posts
-
Day 13 of #100DaysOfLeetCode Problem: 88. Merge Sorted Array Category: Arrays / Sorting / Two Pointers Today’s challenge focused on merging two sorted arrays into one, maintaining the sorted order. It’s a simple yet powerful problem that tests your understanding of array indices, merging logic, and in-place updates. 🧠 Key Learnings: Extended the first array by adding elements from the second, then sorted the combined list. Reinforced the importance of efficient merging techniques for sorted sequences. Understood how in-place operations can reduce memory usage in practical scenarios. Strengthened logic building around sorting fundamentals and index-based insertion. 🎯 Takeaway: Even simple array problems help build strong fundamentals in sorting and data manipulation — the key to mastering larger algorithmic challenges. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Arrays #Sorting #Python #AIEngineer #Consistency
To view or add a comment, sign in
-
-
✅ Day 96 Completed – Inorder Traversal Today’s challenge was all about performing Inorder Traversal on a binary tree — a fundamental operation in tree data structures. 🧩 Concept: Inorder traversal visits nodes in the Left → Root → Right order. The task was to implement it without using recursion or an explicit stack, making it an interesting optimization problem. 💡 Approach: The solution uses the Morris Traversal algorithm, which cleverly utilizes threaded binary trees to achieve traversal in O(1) space complexity. It creates temporary links (threads) to predecessor nodes. Once a node’s left subtree is visited, the link is removed, ensuring no extra memory usage. ⚙️ Key Highlights: Space-efficient (no recursion/stack) Time complexity: O(N) All test cases passed ✅ (1111/1111 with 100% accuracy) 🌱 Takeaway: This problem deepened my understanding of space-optimized tree traversal techniques and their practical applications. #100DaysOfCode #Day96 #GeeksforGeeks #Python #DataStructures #BinaryTree #InorderTraversal
To view or add a comment, sign in
-
-
Day 32 / 100 – Single Number III (LeetCode #260) Today’s challenge was about identifying two unique numbers in an array where every other number appears exactly twice. The twist — it had to be solved in linear time and with constant space. This problem helped me dive deeper into bitwise operations, showing how simple binary logic can reveal elegant patterns hidden inside data. 🔍 Key Learnings XOR can be used to cancel out duplicates and isolate unique values. The rightmost set bit helps separate numbers into logical groups. Bit manipulation offers a powerful way to write optimized and clean algorithms. 💭 Thought of the Day Today reminded me that clever thinking often beats complex logic. When we focus on how data behaves at the bit level, we unlock a new layer of understanding — one that turns code into pure logic. Progress isn’t about solving more; it’s about solving smarter. 🔗 Problem Link:https://lnkd.in/gNjjkBni #100DaysOfCode #Day32 #LeetCode #Python #ProblemSolving #BitManipulation #CodingChallenge #Algorithms #DataStructures #TechGrowth #LearningJourney #CodeEveryday
To view or add a comment, sign in
-
-
Day 15 of #100DaysOfLeetCode Problem: 200. Number of Islands Category: Graph / DFS / Matrix Traversal Today’s challenge was about counting the number of islands in a 2D grid, where each island is represented by connected land cells. This problem is a perfect example of applying Depth-First Search (DFS) to explore connected components in a matrix. 🧠 Key Learnings: Implemented DFS recursively to explore all connected land cells ('1'). Used boundary checks to avoid out-of-range access and prevent redundant traversals. Learned how grid traversal and state marking (changing visited land to '0') help track visited nodes. Strengthened understanding of how recursive search algorithms work in multidimensional data structures. 🎯 Takeaway: Recursive thinking and systematic traversal are powerful tools — understanding them deeply opens the door to solving many graph and matrix problems efficiently. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Graphs #DFS #Recursion #Python #AIEngineer #Consistency
To view or add a comment, sign in
-
-
Day 30 / 100 – Majority Element II (LeetCode #229) Today’s challenge was all about identifying numbers that appear more than ⌊ n/3 ⌋ times in an array. This problem was a great way to explore the Boyer–Moore Voting Algorithm, an elegant and efficient method to find potential majority elements without using extra space. 🔍 Key Learnings Understanding how counters and candidates evolve in an iterative approach Strengthening logic for pattern recognition and frequency analysis Realizing how efficient algorithms can reduce time and memory usage 💭 Thought of the Day Consistency isn’t just about showing up — it’s about learning smarter each day. Every new problem isn’t a repetition; it’s a refinement of logic and discipline. 🔗 Problem Link:https://lnkd.in/gfiGVueC #100DaysOfCode #Day30 #LeetCode #Python #ProblemSolving #CodingChallenge #DataStructures #Algorithms #LearningJourney #CodeEveryday #TechGrowth
To view or add a comment, sign in
-
-
🚀 𝐃𝐚𝐲 𝟏𝟑 𝐨𝐟 #𝟏𝟔𝟎𝐃𝐚𝐲𝐬𝐎𝐟𝐂𝐨𝐝𝐞 — 𝐏𝐚𝐥𝐢𝐧𝐝𝐫𝐨𝐦𝐞 𝐍𝐮𝐦𝐛𝐞𝐫 | 𝐒𝐭𝐫𝐢𝐧𝐠𝐬 🧩 Today’s focus was on a simple yet classic logic check — determining if a number reads the same forward and backward. While it looks straightforward, it’s a great reminder that elegant solutions often come from clarity, not complexity. Problem: 𝐂𝐡𝐞𝐜𝐤 𝐢𝐟 𝐚𝐧 𝐢𝐧𝐭𝐞𝐠𝐞𝐫 𝐢𝐬 𝐚 𝐩𝐚𝐥𝐢𝐧𝐝𝐫𝐨𝐦𝐞. Approach: Convert the integer to a string and compare it with its reverse. Time Complexity: O(n) Space Complexity: O(n) This small exercise reinforces foundational reasoning that scales up when designing more complex systems — where reversing, mirroring, or symmetry detection shows up in data validation, pattern recognition, and even natural language tasks. 🔗 GitHub: https://lnkd.in/gaim_PJS #Python #LeetCode #CodingChallenge #160DaysOfCode #ProblemSolving #DSA #AIEngineerJourney
To view or add a comment, sign in
-
Day 5 of #100DaysOfLeetCode Problem: 54. Spiral Matrix Category: Arrays / Matrix Traversal Today’s challenge focused on traversing a 2D matrix in spiral order and returning all elements in that pattern. This problem was really fun to solve because it required handling multiple edge cases while maintaining clean traversal logic. 🧠 Key Learnings: Used the concept of repeatedly peeling off the outer layer of the matrix. Traversed top row → right column → bottom row → left column in sequence. Understood the importance of checking matrix boundaries after each step to avoid index errors. Improved logical thinking for problems involving nested data structures. 🎯 Takeaway: Matrix traversal problems are all about maintaining control over direction and boundaries — once that’s handled, the logic flows smoothly. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Matrix #Arrays #Python #AIEngineer #Consistency
To view or add a comment, sign in
-
-
Day 14 of #30DaysOfCode with Educative 🟦 Challenge: Binary Tree Zigzag Level Order Traversal Approach: Breadth-first search (BFS) with a direction toggle. Insight: Use BFS to collect nodes level by level, toggling a boolean to decide whether to reverse the collected list for zigzag behavior. Reflection: Implementing zigzag level order traversal shows how simple toggling logic combined with BFS can solve problems that mirror real-world requirements—like managing alternating workflows or data processing sequences in backend systems. #Educative #Python #SoftwareEngineering #ContinuousLearning #ProblemSolving
To view or add a comment, sign in
-
How can we improve regression accuracy (without changing the algorithm itself)? That’s the question I asked while experimenting with a simple car-price dataset. Instead of tuning hyperparameters, I focused on Feature Engineering, specifically by transforming the input variables using polynomial powers (1 to 9). The visualization below shows how increasing the feature power steadily improves the model’s R² score, revealing how non-linear transformations can capture complex relationships better than basic linear features (Visualization result below 👇: R² Score vs Feature Power) Even simple models like LinearRegression can achieve higher accuracy through thoughtful feature engineering, not just parameter tuning. Have you ever tried improving model accuracy through feature transformations? GitHub repository link in the first comment 👇 #FeatureEngineering #MachineLearning #Regression #Python #DataScience #GitHubProjects #Kaggle #RahdanGeoAI
To view or add a comment, sign in
-
-
🚀 Day 3 of #100DaysofDSA Today’s focus was on the “Set Matrix Zeroes” problem — a classic array-matrix question that tests both logic and optimization thinking It began with the brute-force idea: storing all zero positions and then marking corresponding rows and columns later. It works but takes O(m × n) time and O(m + n) extra space. Next, then explored a better approach using two auxiliary arrays to track which rows and columns should be zeroed. This improved the clarity but still consumed additional memory and space. Finally, then to reduce the complexity I tackled the optimal solution, which achieves O(1) extra space by using the first row and first column of the matrix itself as markers. A small Boolean flag handles the edge case when the first row contains a zero. This subtle observation transforms the logic completely — turning a memory-heavy method into a clean in-place algorithm. It was a good reminder that optimization isn’t just about speed — it’s about finding elegance in constraints. #100DaysOfDSA #MatrixProblems #Optimization #SpaceComplexity #Python #ProblemSolving
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