Day 24 / 100 ✅ 🧠 Today’s focus: LeetCode 234 – Palindrome Linked List Instead of just coding it, I paid attention to the pattern behind it. 🔍 What the problem checks: Can we verify if a linked list reads the same forward and backward? ⚙️ My approach: • Traverse the list and store values in a vector • Use two pointers (start & end) • Compare elements until they meet Simple idea. Clear logic. Accepted successfully. 💡 Key takeaway: Even when a problem can be optimized further (O(1) space using reverse technique), understanding the basic comparison approach strengthens fundamentals first. Not every day needs a complex algorithm. Some days are about reinforcing patterns. 24 days in. Still building discipline. 🚀 #100DaysOfCode #LeetCode #DSA #LinkedList #ProblemSolving #CPlusPlus #Regexsoftware
shivam Jeet’s Post
More Relevant Posts
-
Day 12 | LeetCode Progress 🚀 Today, I worked on LeetCode 401 – Binary Watch, a problem that focuses on bit manipulation and binary representation. 🧠 Problem Overview A binary watch uses: 4 LEDs to represent hours (0–11) 6 LEDs to represent minutes (0–59) The task was to return all possible valid times where the total number of LEDs turned on equals a given number. 💡 Key Learnings Applied bit manipulation techniques to count set bits efficiently using __builtin_popcount() in C++. Strengthened understanding of binary representation in practical scenarios. Reinforced the importance of clean formatting and edge case handling (e.g., leading zero in minutes, no leading zero in hours). Learned that sometimes a well-structured brute-force approach is both optimal and readable. 🔍 Approach Iterated through all valid hour (0–11) and minute (0–59) combinations and selected those where the total number of set bits matched the input condition. Time Complexity: O(1) (since the search space is fixed at 720 combinations) Consistent practice is helping me improve my logical thinking and problem-solving efficiency every day. 📈 Day 12/100 — Building discipline through daily DSA practice. #100DaysOfCode #DSA #CPlusPlus #LeetCode #ProblemSolving #SoftwareEngineering #ComputerScience
To view or add a comment, sign in
-
-
Day 4 of My LeetCode Consistency Journey Today I solved LeetCode 151 – Reverse Words in a String (Medium). This problem focuses on: String manipulation Handling extra spaces Efficient traversal Edge case management 💡 Key Learning: Understanding how to properly parse words, remove leading/trailing spaces, and reconstruct the string efficiently improves logical thinking and strengthens DSA fundamentals. Instead of relying on built-in shortcuts, I focused on: ✔️ Clean logic ✔️ Optimized approach ✔️ Handling edge cases carefully Consistency > Motivation 💯 #LeetCode #DSA #ProblemSolving #CodingJourney #Cplusplus #100DaysOfCode #SoftwareEngineering #TechGrowth
To view or add a comment, sign in
-
Day 40 / 100 – LeetCode Challenge 🚀 Problem Solved: Check if All Characters Have Equal Number of Occurrences (LeetCode 1941) Goal: Check whether every character in the string appears the same number of times. Approach: – Use a map to store frequency of each character – Count occurrences while traversing the string – Compare the frequency of all characters with the first stored frequency – If any frequency differs → return false Concepts Used: • Hash Map • Frequency Counting • String Traversal Performance: ⚡ Runtime: 3 ms 🧠 Memory: 9.55 MB Another small step in the 100 Days of LeetCode Challenge. Consistency and daily practice make the difference. #100DaysOfCode #LeetCode #DSA #CPlusPlus #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
💻 Day 14 – LeetCode Practice Solved Reverse String (LeetCode 344) today. The task was to reverse a character array in-place without using extra memory. I implemented the two-pointer approach: One pointer starts from the beginning. Another pointer starts from the end. Swap the characters and move both pointers towards the center. This approach ensures an efficient in-place reversal. ⏱ Time Complexity: O(n) 📦 Space Complexity: O(1) Small problem, but it strengthens understanding of two-pointer techniques and in-place operations. Consistency is the real key 🔁🚀 #LeetCode #CPlusPlus #DSA #TwoPointer #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 LeetCode Daily Challenge – Binary Gap 📌 Problem: Binary Gap 🔗 LeetCode - Daily Question Today’s problem focused on analyzing binary representation using bit manipulation. The goal: Find the maximum distance between two consecutive set bits (1s) in a number’s binary form. Brute force string conversion? Possible—but unnecessary. ❌ Bitwise traversal? Clean and optimal. ✅ 💡 Key Insight: - Traverse bits from LSB to MSB - Track the position of the last seen "1" - For every new "1", compute distance from previous - Maintain the maximum gap 🛠 Approach: • Iterate while "n > 0" • Check "(n & 1)" for set bit • Track positions using a counter • Update max distance • Right shift "n" ⏱ Complexity: Time: O(log n) Space: O(1) ✔ Accepted ✔ Clean bit manipulation logic ✔ Reinforced fundamentals of binary traversal Takeaway: Sometimes the simplest bit tricks outperform heavier approaches—clarity wins. Practicing DSA daily with LeetCode, learning alongside CoderArmy, and guided by Rohit Negi, Aditya Tandon Day 26 done. Staying consistent. 🚀 #Day26/90 #LeetCode #DSA #BitManipulation #ProblemSolving #CPlusPlus #LearningInPublic #ProblemSolving2026
To view or add a comment, sign in
-
-
17 of #100DaysOfCode 💻🔥 Today I solved Add Two Numbers (Linked List) — one of the most classic and fundamental Linked List problems on LeetCode. Instead of converting numbers directly, the challenge is to simulate addition digit by digit while handling carry properly — just like we do in real life math 🧮 💡 Key Learnings: ✔️ Importance of using a dummy node to simplify edge cases ✔️ Proper handling of carry across iterations ✔️ Traversing two linked lists simultaneously ✔️ Clean pointer manipulation avoids unnecessary bugs #100DaysOfCode #DSA #LinkedList #LeetCode #CodingJourney #ProblemSolving #CPlusPlus #TechGrowth
To view or add a comment, sign in
-
-
🚀 Day 70 of LeetCode Problem Solving Journey — 100 Days LeetCode Challenge Today, I solved LeetCode #507 — Perfect Number using C++, under the guidance of Trainer NEKAL SINGH SALARIA Singh at REGex Software Services. 🔍 Problem Summary: A perfect number is a positive integer that is equal to the sum of its positive divisors excluding the number itself. Given an integer num, return true if it is a perfect number, otherwise return false. 🧠 Approach Used (Divisor Summation): I calculated the sum of all divisors except the number itself: Traverse from 1 to num/2 Check if the number divides num evenly If yes → add it to the sum After the loop, compare the sum with num If both are equal → it is a perfect number This approach directly verifies the definition of a perfect number. 📚 Key Learnings of the Day ✔ Perfect numbers are equal to the sum of their proper divisors ✔ Checking divisors is a common technique in number theory problems ✔ Understanding mathematical definitions simplifies coding logic ✔ Brute-force solutions are sometimes useful as a starting point ⏱ Complexity • Time Complexity: O(n) • Space Complexity: O(1) 💡 Optimization Insight: The loop can be optimized by checking divisors only up to √n, which reduces the time complexity significantly. Another step forward in the challenge — see you on Day 71 🚀 #Day70 #100DaysLeetCodeChallenge #LeetCode #RegexSoftwareServices #NekalSingh #ProblemSolving #DSA #CPlusPlus #CodingChallenge #ProgrammingJourney #Math #KeepGrowing
To view or add a comment, sign in
-
-
LeetCode Daily | Day 41 🔥 LeetCode POTD – 190. Reverse Bits (Easy) ✨ 📌 Problem Insight Given a 32-bit integer, reverse its bits and return the resulting integer. ⚠️ Important: We must treat the number as pure 32-bit binary, not as signed/unsigned logic. 🔍 Approach Instead of converting to string, use bit manipulation. 1️⃣ Initialize ans = 0 2️⃣ Iterate 32 times 3️⃣ Extract last bit using (n & 1) 4️⃣ Left shift ans to make space 5️⃣ Add extracted bit using ans |= bit 6️⃣ Right shift n Pure bit operations. No string conversion. 💡 Why This Works • Processes exactly 32 bits • Avoids extra space • Constant time • Cleaner and interview-friendly For repeated calls (follow-up), we can optimize using a lookup table for 8-bit chunks. ⏱ Complexity Time: O(32) → O(1) Space: O(1) 🧠 Pattern Bit Manipulation | Shifting | Masking Even easy problems test low-level understanding. Mastering bits = stronger fundamentals. Consistency over motivation — one problem a day 🚀 #LeetCode #DSA #BitManipulation #Cplusplus #CodingDaily #Consistency
To view or add a comment, sign in
-
-
🚀 Day 6 of My LeetCode Consistency Journey Today I solved LeetCode 20 – Valid Parentheses (Easy). Even though it’s labeled easy, it strongly tests understanding of: Stack data structure Matching brackets logic Edge case handling Proper order validation 💡 Key Insight: The order matters more than the count. A stack helps ensure every opening bracket has the correct closing bracket in the right sequence. This problem reinforces core DSA fundamentals that are frequently asked in coding interviews. Consistency builds confidence. On to Day 7 🚀 #LeetCode #DSA #Stacks #ProblemSolving #Cplusplus #CodingJourney #100DaysOfCode #SoftwareEngineering
To view or add a comment, sign in
-
Day 5 of My LeetCode Journey Today I solved LeetCode 150 – Evaluate Reverse Polish Notation (Medium). This problem strengthened my understanding of: Stack data structure Postfix expression evaluation Operator handling (+, -, *, /) Edge case management (negative numbers & division) 💡 Key Learning: Reverse Polish Notation removes the need for parentheses, but requires strong stack logic and careful operand order handling. This problem reinforced how powerful stacks are in expression evaluation and real-world compiler logic. Consistency is the real game changer. On to Day 5 🚀 #LeetCode #DSA #Stacks #ProblemSolving #Cplusplus #CodingJourney #SoftwareEngineering #100DaysOfCode
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