🚀 Day 7 of My LeetCode Journey — Sorting Fundamentals Today I focused on two classic sorting algorithms: 🔹 Bubble Sort 🔹 Selection Sort 💡 Bubble Sort The idea is simple: 👉 Compare adjacent elements 👉 Swap if they are in the wrong order 👉 Repeat until the array is sorted It’s easy to understand, but not efficient for large datasets. ⏱️ Time Complexity: O(n²) 💡 Selection Sort A slightly different approach: 👉 Find the minimum element 👉 Place it at the correct position 👉 Repeat for the rest of the array Also simple, but still not optimal for big inputs. ⏱️ Time Complexity: O(n²) 🔥 Key Takeaways: These algorithms may not be optimal, but they build strong fundamentals Understanding how sorting works internally is more important than memorizing Optimization comes later — basics come first Big thanks to Namaste DSA and Akshay Saini 🚀 for guiding this journey Consistency is the real win — Day 8 loading 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #Sorting #BubbleSort #SelectionSort #NamasteDSA
Sanjeev Kumar’s Post
More Relevant Posts
-
🚀 Day 6 of My LeetCode Journey — Search Like a Pro Today was all about mastering the fundamentals of searching: 🔹 Linear Search 🔹 Binary Search (LeetCode 704) 💡 Problem 1: Linear Search The most straightforward approach: 👉 Traverse each element 👉 Compare until you find the target Simple, but important to understand its limitation: ⏱️ Time Complexity: O(n) 💡 Problem 2: Binary Search This is where things get interesting 🔥 👉 Works only on sorted arrays 👉 Divide the search space in half every step Result: ⏱️ Time Complexity: O(log n) 🚀 This problem really helped me understand how powerful optimization can be when the data is structured correctly. 🔥 Key Takeaways: Always check if the array is sorted → you might use Binary Search Optimization often comes from reducing the search space Fundamentals like searching form the base of everything in DSA Grateful for the learning journey with Namaste DSA and Akshay Saini 🚀 Day 7 coming up 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #BinarySearch #LinearSearch #NamasteDSA
To view or add a comment, sign in
-
Not all code is compiled. Some code runs instantly. No build. No install. No waiting. 👉 That’s called interpretation. When you open a website, the code isn’t pre-compiled like apps. Your browser reads it and runs it on the spot. Same with some languages: They don’t convert everything before running. They execute it line by line. That’s why: - You can run JavaScript instantly - You can execute Python without building apps - Websites load without installation But there’s a trade-off: More flexibility… less raw performance. Compiled → faster Interpreted → more flexible Both exist. Both matter. This is Part 4 of the series. Tomorrow: the hidden layer that makes both work smoothly (runtimes). Follow if you want to actually understand how code runs in real systems. #Programming #Coding #WebDevelopment #JavaScript #Python #SoftwareDevelopment #TechExplained #Developers #ComputerScience
To view or add a comment, sign in
-
-
🚀 Day 4 of My LeetCode Journey — Building Problem-Solving Muscle Today I worked on two problems: 🔹 Max Consecutive Ones (LeetCode 485) 🔹 Missing Number (LeetCode 268) 💡 Problem 1: Max Consecutive Ones This problem is all about pattern recognition. 👉 Traverse the array 👉 Keep counting consecutive 1s 👉 Reset when you hit 0 Simple logic, but a great reminder that not every problem needs complex data structures. 💡 Problem 2: Missing Number This one was interesting — multiple ways to solve it: ✔️ Sorting ✔️ HashSet ✔️ XOR ✔️ Sum formula (most optimal) The cleanest approach: 👉 Use the formula: n * (n + 1) / 2 👉 Subtract the actual sum 👉 Boom — missing number found ⚡ 🔥 Key Takeaways from Today: Not every problem needs brute force There’s always a more optimal way — look for patterns Understanding multiple approaches = stronger fundamentals Consistency is slowly turning confusion into clarity 💪 On to Day 5 🚀 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #Consistency #CodeNewbie #DailyCoding
To view or add a comment, sign in
-
3 months. 3 prototypes. Here's the breakdown. I started 2026 with one goal: move my ideas to prototype phase and don't keep it just for myself. This is what Q1 looked like: 1. ProjectHack - a web app for early-career developers: people finish courses but can't build or explain a project end-to-end. What it does: pick your level, get a scoped project idea, follow the steps, export a CV-ready summary. Stack: Django, Tailwind, SQLite. Build time: ~12 hours. 2. Compute Specs DB - a CPU/GPU spec database with API Problem: datacenter hardware specs are scattered across vendor pages and outdated wikis. I needed a reliable source. What it does: search, filter, compare, and visualize 170+ manually validated CPU specs. REST API included. Stack: FastAPI, SQLite, Plotly. Build time: Few hours building, and another 6-10 data validation. 3. LocalUtilityBox - a local CLI toolkit published on PyPI: simple file tasks (convert HEIC, compress PDF, extract audio) mean uploading files to websites you don't trust. What it does: 28+ CLI commands that run entirely on your machine. Images, PDFs, media, OCR, QR codes. Optional GUI included. Stack: Python, published via pipx. No uploads. No accounts. Build time: 12-20h with all debugging included. All three are live. All three solve something I actually ran into and I am happy that I started doing it. None of them are finished products. That's fine. The goal was never perfection. It was to build the habit of shipping, get real feedback, and decide what's worth continuing. Q2 starts now :) Let's keep going! I added links to those projects in the comments if you r interested! #BuildInPublic #FromIdeaToPrototype #Python #OpenSource #SideProjects #CLI #FastAPI #ProductThinking #CareerGrowth #Tech
To view or add a comment, sign in
-
-
🚀 A Major Update is Coming to CodeAlive (Live in 3–4 Days!) I honestly started CodeAlive as a small platform with a simple goal in mind — to let my code snippets live over the internet with support for custom sharable links. But seeing how far it has come now, evolving into a platform with so many useful and smart features for everyone, has been incredibly exciting. 🌐 CodeAlive – https://lnkd.in/gnthhf_b 👉 Also, you can click "View My Website" on my profile to visit the platform. What’s Coming Next ⏭️ CodeAlive is soon introducing: **Multi-Language Detection & Highlighting in a Single Code File** Problem: Almost every code-sharing platforms and online editors are built around one assumption: 1 File = 1 Language But real-world development is rarely that simple. Developers often share: ✅ Frontend + Backend snippets together ✅ Embedded scripts/styles ✅ Configurations with code ✅ Multi-language examples in one paste And when platforms force a single language highlight, readability suffers. With This New Update, CodeAlive Will Support ✅ Detecting multiple languages within one pasted code file ✅ Highlighting different sections based on actual context/language ✅ Making mixed-language snippets cleaner, smarter, and easier to read This has been one of the most exciting features to work on so far, and I can’t wait to share the full implementation details once it officially goes live. 📅 Expected Release: 3–4 Days Stay tuned 👀 More technical insights coming soon... #CodeAlive #BuildInPublic #Programming #SoftwareDevelopment #DeveloperTools #WebDevelopment #Python #JavaScript #StartupJourney
To view or add a comment, sign in
-
-
Been spending some time revisiting fundamentals lately — and honestly, nothing beats clean, simple code. In a world full of frameworks and shortcuts, it’s easy to forget that strong basics still do most of the heavy lifting. A few small snippets I’ve been reflecting on: Python # Clean and readable always wins def find_max(numbers): return max(numbers) if numbers else None JavaScript // Simplicity > over-engineering const uniqueItems = arr => [...new Set(arr)]; SQL -- Good queries save hours later SELECT customer_id, COUNT(*) AS total_orders FROM orders GROUP BY customer_id ORDER BY total_orders DESC; Nothing fancy here — but that’s the point. The real difference often comes from writing code that: someone else can understand quickly you can debug without frustration actually scales without breaking everything Tech keeps evolving, but clarity, structure, and logic never go out of style. Curious — what’s one coding principle you always stick to, no matter the language or stack? #Coding #Technology #SoftwareDevelopment #CleanCode #Programming #Developers
To view or add a comment, sign in
-
🚀 Solved: Valid Parentheses (Stack Based Problem) Today I worked on a classic problem that looks simple but tests your core logic 👇 🧠 Problem: Given a string containing only (), {}, [] 👉 Check if the parentheses are valid 💡 Approach I used: Used a stack Push opening brackets For closing brackets: Check top of stack If match → pop Else → invalid ⚙️ Key Insight: 👉 Order matters more than count 👉 Stack helps track the sequence correctly 🔥 What I learned: Importance of stack in real problems Handling edge cases (empty stack, mismatch) Writing clean conditional logic 📌 Time Complexity: O(n) 📌 Space Complexity: O(n) 💬 Have you solved this problem differently? Would love to know your approach! #javascript #cpp #datastructures #algorithms #coding #leetcode #interviewprep
To view or add a comment, sign in
-
-
Day#17 💡Cracked LeetCode #202 – Happy Number! Ever wondered if a number can be happy? 😄 Turns out, in programming… it can! 🔍 Problem Statement: A number is called Happy if: You replace the number by the sum of the squares of its digits Repeat the process If it eventually becomes 1 → it's a Happy Number If it falls into a loop → Not Happy ❌ 🧠 Key Insight: This problem is not about math… it's about cycle detection! We keep transforming the number: 👉 If we reach 1 → Done ✅ 👉 If we revisit a number → Loop detected 🔁 Approaches: 1️⃣ Using HashSet Store visited numbers Detect loop easily Time: O(log n), Space: O(log n) 2️⃣ Floyd’s Cycle Detection (Fast & Slow Pointer) 🚀 Same concept as Linked List cycle No extra space needed Time: O(log n), Space: O(1) 💻 JavaScript Code (Floyd’s Approach): var isHappy = function(n) { const getNext = (num) => { let sum = 0; while (num > 0) { let digit = num % 10; sum += digit * digit; num = Math.floor(num / 10); } return sum; }; let slow = n; let fast = getNext(n); while (fast !== 1 && slow !== fast) { slow = getNext(slow); fast = getNext(getNext(fast)); } return fast === 1; }; 🔥 What I Learned: Cycle detection isn’t just for linked lists Mathematical problems often hide pattern recognition Always think: Can this loop forever? 📌 Example: 19 → 82 → 68 → 100 → 1 ✅ (Happy Number) #LeetCode #DSA #ProblemSolving #CodingInterview #JavaScript
To view or add a comment, sign in
-
🚀 Day 12 of My LeetCode Journey — Linked List Patterns Getting Stronger Today’s problems: 🔹 Intersection of Two Linked Lists (LeetCode 160) 🔹 Remove Linked List Elements (LeetCode 203) 💡 Problem 1: Intersection of Two Linked Lists Explored two approaches: ✅ Brute Force Traverse headA and check every node in headB ⏱️ Time: O(m × n) ✅ Using Set Store all nodes of headB in a Set Traverse headA and check for intersection ⏱️ Time: O(m + n) | 📦 Space: O(n) 👉 Helped me understand how hashing can optimize comparisons. 💡 Problem 2: Remove Linked List Elements Solved using a Sentinel (Dummy) Node 🔥 👉 Create a dummy node before head 👉 Use prev pointer to skip unwanted nodes: prev.next = prev.next.next This approach simplifies edge cases like: Removing head node Multiple consecutive deletions 🧠 What I Learned: Sentinel nodes make linked list problems cleaner Hashing can reduce time complexity significantly Thinking in terms of nodes (not values) is key 🔥 Key Takeaways: Always look for ways to reduce nested loops Dummy nodes = lifesaver in linked list problems Practice is making pointer manipulation more intuitive Grateful for the guidance from Namaste DSA and Akshay Saini 🚀 Day 13 loading… 💪 #LeetCode #DataStructures #Algorithms #CodingJourney #100DaysOfCode #SoftwareEngineering #Programming #InterviewPrep #JavaScript #CodingLife #TechGrowth #ProblemSolving #Developers #LearnToCode #LinkedList #DSA #NamasteDSA #AkshaySaini
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