🌟 Day 22 of #100DaysOfDSA Today, I solved two interesting problems: 1️⃣ Reverse a Linked List Reversed a singly linked list by iteratively changing the node pointers. Time Complexity: O(n) Space Complexity: O(1) 2️⃣ Move Zeroes Rearranged all zeroes in an array to the end while maintaining the order of non-zero elements — done in-place with linear time. Time Complexity: O(n) Space Complexity: O(1) Both problems were great practice for improving logical thinking and working efficiently with pointers and arrays. https://lnkd.in/gt7VYQ_E #100DaysOfCode #DSA #JavaScript #CodingJourney #LearningInPublic #LeetCode
Solved Reverse Linked List and Move Zeroes problems in JavaScript
More Relevant Posts
-
🧠 Day 20 of #100DaysOfDSA Today I practiced two classic problems from LeetCode — FizzBuzz and Reverse String. 📘 What I learned: These might look like simple problems, but they help sharpen logic building, loops, and condition handling — essential building blocks for bigger challenges. 💻 Problems Solved: 1️⃣ FizzBuzz – A fun way to practice modular arithmetic and condition prioritization. 2️⃣ Reverse String – Implemented using the two-pointer approach for an in-place reversal. 💡 Key Takeaways: FizzBuzz reinforces thinking through branching logic. The two-pointer method is efficient for array and string manipulation. Small problems like these build the foundation for complex algorithms. 🔗 Check out my implementations here: https://lnkd.in/gxs9yaen #100DaysOfCode #DSA #LeetCode #JavaScript #CodingJourney #ProblemSolving #LearningInPublic
To view or add a comment, sign in
-
Day 23/90 – 90 Days DSA Challenge Today I practiced another classic recursion problem — Sum of first N natural numbers using recursion 💡 🧠 Concept Recap: Recursion is when a function calls itself with a smaller input until it reaches a base condition. It’s like peeling an onion layer by layer — until you reach the core 🧅 ⚙️ Problem Statement: 👉 Write a function sum(n) that calculates the sum of the first n natural numbers. 🧩 Example: Input: 5 Process: 5 + 4 + 3 + 2 + 1 = 15 Output: 15 Time Complexity: O(n) 💾 Space Complexity: O(n) (due to call stack) ✨ Key takeaway: Recursion helps break down complex problems into smaller, simpler ones — it’s elegant, powerful, and mind-opening once you get the hang of it! #Day23 #DSA #Recursion #JavaScript #CodingChallenge #MechCode #LearningInPublic #FrontendDeveloper #CodeEveryday
To view or add a comment, sign in
-
-
📘 Day 175 of #200DaysOfCode Today, I explored how to count the number of properties in a JavaScript object — a small but meaningful step toward understanding how objects truly work under the hood. 🧠 Key Concepts Practiced • Working with objects • Looping through keys using for...in • Using hasOwnProperty() to avoid inherited keys • Returning calculated output 🌍 Real-World Uses ✅ Validating form inputs ✅ Checking JSON response structures ✅ Data integrity checks ✅ Object analysis in APIs 🔎 Learning takeaway: Even the simplest operations help you develop a deeper understanding of core JavaScript behavior. Mastering the fundamentals builds confidence for tackling complex problems later. #JavaScript #Day175 #175DaysOfCode #ProblemSolving #CodingChallenge #WebDevelopment #LogicBuilding #BackToBasics #LearnInPublic #DeveloperJourney #CodingMindset
To view or add a comment, sign in
-
-
#Day68 of #100DaysOfCode Topic: JavaScript Promises Concepts Covered: Understanding Asynchronous and Synchronous behavior Learning about Promise states (Pending, Fulfilled, Rejected) Using then() and catch() syntax Implementing Promise Chaining for cleaner asynchronous code Learned how Promises make async operations more manageable and improve code readability. Practiced in Code Playground console.log("Become the programmer you wish to be!"); Day 68/100 — Exploring the power of Asynchronous JavaScript #CCBP #jpnce #NxtWave #JavaScript #Promises #AsyncJS #WebDevelopment #100DaysOfCode #Day68 #LearningNeverStops
To view or add a comment, sign in
-
-
Day 4 of #100DaysOfNeetCode | #NeetCode150 Today’s challenge was the classic Three Sum problem, one that tests sorting, two-pointer logic, and careful duplicate handling. Three Sum -> Goal: Find all unique triplets in the array which sum up to zero. -> Brute Force: Use three nested loops to check every triplet. This works but runs in O(n³), making it inefficient for larger inputs. -> Optimized: Sort the array first. Fix one number and then use the two-pointer approach to find pairs that make the total zero. Skip duplicate numbers to avoid repeating triplets. Time Complexity: O(n²) Key idea: Sorting plus the two-pointer method helps efficiently reduce complexity while managing duplicates gracefully. Example: nums = [-1, 0, 1, 2, -1, -4] → Output: [[-1, -1, 2], [-1, 0, 1]] Takeaway: Sorting combined with pointer movement is a powerful approach for problems involving sums within an array. #Day4 #JavaScript #LeetCode #NeetCode150 #DSA #ProblemSolving #100DaysOfNeetCode #CodingJourney
To view or add a comment, sign in
-
-
Today I practiced one of the classic algorithm problems — implementing the atoi (string to integer) function manually in JavaScript. This problem helps understand: String parsing Handling whitespace and signs Managing integer overflow and boundaries (INT_MAX, INT_MIN) Character to digit conversion using charCodeAt() Here’s a short summary of what my code does: Skips leading spaces Checks for '+' or '-' sign Converts valid numeric characters into an integer Stops at the first invalid character Returns result within 32-bit integer range #JavaScript #CodingChallenge #LeetCode #WebDevelopment #ProblemSolving #LearningJourney
To view or add a comment, sign in
-
-
🧩 Day 4 – Mastering Objects & Arrays Day 4 was all about Objects and Arrays — the backbone of JavaScript data handling. I learned how to create, modify, and loop through them efficiently. Also explored methods like map(), filter(), and reduce() — game changers for clean, readable code! 💡 Realized how these methods simplify complex logic into elegant one-liners. 💬 Which one do you use the most — map, filter, or reduce? #JavaScript #WebDevelopment #CodingChallenge #FrontendLearning #gfg #geeksforgeeks #React
To view or add a comment, sign in
-
Find the Single Non-Duplicate Element in a Sorted Array 👉 Day 20 / Day 93 👈 🔥 challenge: Find the single non-duplicate element in a sorted array where every other element appears exactly twice. 🔥Instead of using extra space or a linear scan, we use a Binary Search approach to achieve O(log n) time complexity and O(1) space. 🔥 #JavaScript #CodingInterview #DSA #LeetCode #ProblemSolving #BinarySearch #FrontendEngineer #100DaysOfCode
To view or add a comment, sign in
-
-
DSA Practice — Day 7 Solved the “Remove Duplicates from Sorted Array” problem on LeetCode. 🧩 Approach: • First, understood the problem statement clearly. • Analyzed the given examples and patterns. • Performed a dry run on paper to visualize the algorithm. • Implemented a pointer-based approach to remove duplicates efficiently. “Clarity before code — that’s how you build problem-solving discipline.” #DSA #LeetCode #ProblemSolving #JavaScript #LearningInPublic #CodingJourney #BackendDeveloper
To view or add a comment, sign in
-
-
Day 6 of #100DaysOfNeetCode | #NeetCode150 Today I worked on the Valid Parentheses problem — a classic question that tests stack operations and understanding of string parsing logic. Valid Parentheses -> Goal: Determine if a string containing only '(', ')', '{', '}', '[' and ']' is valid. A valid string must have matching and correctly ordered brackets. -> Brute Force: Repeatedly remove pairs like (), {}, [] until no more replacements can be made. Return true if the string becomes empty. Time Complexity: O(n²) due to multiple passes. -> Optimized: Use a stack to push opening brackets and pop them when a valid closing match appears. Use a map to pair closing brackets with their corresponding openings. Return true if the stack is empty at the end. Key idea: The stack ensures last opened brackets are closed first (LIFO). Example: str = "()" → Output: true str = "([{}])" → Output: true str = "(]" → Output: false Time Complexity: O(n) Takeaway: Stack-based approaches are powerful for problems involving nested or sequentially dependent structures. #Day6 #JavaScript #LeetCode #NeetCode150 #DSA #ProblemSolving #100DaysOfNeetCode #CodingJourney
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