🚀 Day 38/60 — LeetCode Discipline Problem Solved: Build an Array With Stack Operations Difficulty: Medium Today’s problem revolved around simulating stack operations to construct a target array using a stream of numbers. By carefully deciding when to Push and when to Pop, I built the required sequence efficiently. 💡 Focus Areas: • Stack fundamentals (Push & Pop) • Simulation-based problem solving • Conditional logic building • Understanding sequence construction • Improving step-by-step thinking ⚡ Performance Highlight: Achieved 0 ms runtime (100% performance) Every number entered the stack… but not all were meant to stay. Some were pushed forward, others quietly removed— until only the desired sequence remained. #LeetCode #60DaysOfCode #100DaysOfCode #DSA #Stack #Simulation #CodingJourney #ProblemSolving #Python #Developers #TechGrowth #Consistency
Aman Sharma’s Post
More Relevant Posts
-
🚀 Just solved the “Valid Number” problem on LeetCode! This problem looks simple at first glance—but handling edge cases like decimals, signs, and exponents makes it a great test of attention to detail and logical thinking. ✅ Key takeaways: Careful handling of edge cases is crucial Validating input step-by-step can simplify complex parsing problems Writing clean, readable logic beats overcomplicated solutions 💡 Performance: ⚡ Runtime: 3 ms 🧠 Efficient space usage ✅ All test cases passed Problems like this remind me that consistency in practice is what builds strong problem-solving skills. On to the next one! 🔥 #LeetCode #Coding #Python #ProblemSolving #SoftwareEngineering #AIEngineerJourney link of #Solution :- https://lnkd.in/ga9b5pVb
To view or add a comment, sign in
-
-
Day 10/100 – DSA Challenge Today’s problem: Move Zeroes (LeetCode 283) What I Learned: The goal was to move all zeroes to the end of an array while maintaining the relative order of non-zero elements — and importantly, doing it in-place. Key Idea: Two-Pointer Technique I used a two-pointer approach: One pointer (fast) iterates through the array Another pointer (slow) tracks where the next non-zero element should go Whenever a non-zero element is found, it is swapped with the element at the slow pointer, ensuring all non-zero elements are shifted forward while zeroes naturally move to the end. Why this approach? Maintains order of elements Works in O(n) time complexity Uses O(1) extra space (in-place) Takeaway: This problem reinforced how powerful the two-pointer technique is for array manipulation problems, especially when constraints require in-place operations. Looking forward to tackling more problems and improving consistency! #Day10 #100DaysOfCode #DSA #Python #CodingJourney #LeetCode #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Cracked another classic coding problem on LeetCode! Solved the “Square Root (x)” problem using an optimized Binary Search approach — without using any built-in power functions. 💡 Key Highlights: Achieved efficient O(log n) time complexity Handled edge cases and avoided overflow using division Clean and interview-ready implementation ✅ Result: All test cases passed (1019/1019) Runtime: 2 ms (Beats ~60% submissions) This problem is a great reminder of how powerful Binary Search can be beyond just sorted arrays. 📌 Always focus on: Writing optimized logic Understanding constraints deeply Practicing consistently On to the next challenge 💻🔥 #LeetCode #Coding #BinarySearch #Python #ProblemSolving #SoftwareEngineering #InterviewPrep link of #Solution :- https://lnkd.in/gaaMJxTu)
To view or add a comment, sign in
-
-
🚀 Day 7 – LeetCode Journey Today’s problem: String to Integer (atoi) This one really tested my understanding of edge cases and string parsing. Not just coding, but thinking like a machine step-by-step 👇 ✅ Ignored leading whitespaces ✅ Handled positive & negative signs ✅ Extracted numbers until non-digit appears ✅ Managed overflow within 32-bit integer range At first, it looked simple… but the edge cases made it interesting 😅 💡 Key Learning: Writing code is one thing, but handling all possible inputs correctly is what truly matters in real-world problems. Slowly getting better at breaking down problems and building clean logic 💻🔥 On to Day 8… 🚀 #Day7 #LeetCode #CodingJourney #Python #ProblemSolving #Consistency #LearningEveryday
To view or add a comment, sign in
-
-
🚀 Solved today’s LeetCode challenge: Longest Common Prefix 💻🔥 Problem: Given an array of strings, find the longest common starting substring among all strings. ✅ Example: ["flower", "flow", "flight"] → "fl" ["dog", "racecar", "car"] → "" 🧠 My Approach: Started with the first word as a prefix and compared it with the remaining strings one by one. Whenever a mismatch happened, I kept shrinking the prefix from the end until it matched. This helped me understand: 🔹 String slicing in Python 🔹 Prefix matching logic 🔹 Edge case handling 🔹 Writing optimized clean code 💡 Time Complexity: O(n * m) (n = number of strings, m = prefix length) Consistency > Motivation. One problem every day builds strong problem-solving skills 📈 Check Out : https://lnkd.in/dtumdVUQ #LeetCode #Python #DSA #CodingJourney #ProblemSolving #100DaysOfCode #SoftwareEngineer #Programming #Tech #Learning
To view or add a comment, sign in
-
Code that writes code. 🌌 There is a point in every developer's journey where you stop thinking about Logic and start thinking about Patterns. Advanced Python is about: ~Abstraction: Using Protocols and Generics for structural typing. ~Automation: Using advanced Decorators to inject behavior across entire systems. ~Reliability: Understanding the memory manager so you can prevent leaks before they start. We use these "hidden" features not to make the code more complex, but to make the usage of our code more simple for everyone else. Which part of the "Advanced Mindset" was the hardest for you to learn? For me, it was finally mastering asyncio flow control. #CleanCode #Pythonic #ProgrammingPrinciples #SystemDesign #AdvancedCoding
To view or add a comment, sign in
-
-
🚀 Just solved the Power of Two problem on LeetCode — and here’s a quick look at my approach 👇 Instead of jumping straight into bit manipulation, I focused on a simple iterative logic: 🔹 Start from 2 🔹 Keep multiplying by 2 🔹 Check if we reach the given number 🔹 If yes → it’s a power of two ✅ 🔹 If we overshoot → it’s not ❌ 💡 This approach emphasizes clarity over cleverness — building intuition step-by-step before optimizing further. While there are more optimized solutions (like bit tricks), I believe: 👉 Strong fundamentals > premature optimization 📊 Result: ✔️ 100% runtime efficiency ✔️ Clean and readable logic Always aiming to improve not just what I solve, but how I think 💭 #LeetCode #DSA #ProblemSolving #Python #CodingJourney #100DaysOfCode #WomenInTech #FutureEngineer #TechGrowth #Consistency #LearnInPublic #CodingLife #SoftwareEngineering #DeveloperMindset
To view or add a comment, sign in
-
-
🚀 Day 38 – LeetCode Journey Today’s problem: Gray Code ✔️ Generated sequence using bit manipulation ✔️ Applied formula: "i ^ (i >> 1)" ✔️ Ensured only one bit changes between consecutive numbers 💡 Key Insight: Gray Code is useful in minimizing errors in digital communication, as only one bit changes at a time. Using bitwise operations makes the solution both elegant and efficient. This problem improved my understanding of bit manipulation and binary patterns. Exploring deeper into low-level concepts 🔥💪 #LeetCode #Day38 #BitManipulation #Binary #Python #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 75 of #100DaysOfCode 🔥 LeetCode 179 – Largest Number 💡 Problem: Given a list of non-negative integers, arrange them such that they form the largest possible number. 🧠 Key Insight: Normal sorting won't work here ❌ We need a custom comparator based on string concatenation. 👉 Compare: - ""a + b"" vs ""b + a"" - Whichever gives a larger value should come first. ⚙️ Approach: 1. Convert numbers to strings 2. Sort using custom comparison logic 3. Join the result 4. Handle edge case (like "[0,0] → "0"") ⚡ Complexity: - Time: O(n log n) - Space: O(n) 🎯 Result: ✅ Accepted ⚡ Runtime: 0 ms (100%) 📌 Lesson Learned: Sometimes sorting logic depends on combination, not value. #LeetCode #Python #CodingJourney #DSA #100DaysOfCode #Sorting #ProblemSolving
To view or add a comment, sign in
-
-
A lot of systems today are built to be “responsive.” I care more about systems that are bounded. That is part of why I made atlas-kvd-demo: a tiny Python toy where state evolves through: K — what the system carries V — what the world pushes onto it Δ — what a local event changes The point is simple: instead of jumping from 0 to 100 every time something happens, a system can update in a way that is legible, constrained, and stable. https://lnkd.in/e8WFcFPv Tiny demo. Bigger direction. #Python #SystemsDesign #Simulation #AIEngineering #GitHub #BuildInPublic #Tech
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