🚀LeetCode #5 – Longest Palindromic Substring (C++ Solution) Just solved LeetCode Problem #5 — one of those classic challenges that really tests your understanding of string manipulation and dynamic programming. This problem made me slow down and think carefully about how to expand around centers efficiently and optimize without brute force. It’s a great example of how small improvements in logic can drastically change performance. 🧠 Concept: Find the longest substring that reads the same forward and backward. Approach used: Expand Around Center — checking every possible center in O(n²) time but with constant space. 💻 Tech Stack: C++ ⚙️ Focus: Optimization, logic clarity, and clean code structure. Every problem like this strengthens how I think about data patterns — and that’s exactly the kind of mindset I bring into real game logic and system design. #LeetCode #Cplusplus #Coding #ProblemSolving #GameDev #Programming
Solved LeetCode #5 Longest Palindromic Substring in C++
More Relevant Posts
-
🚀 Final chapter of my LINQ series is out! After exploring IEnumerable, yield return, and unit testing, it’s time to put everything together by building our own LINQ methods from scratch. In this article, I share how I used this project to teach my team that LINQ isn’t “magic”, it’s just clean, powerful C# code. We implement .Where() and .Any() step by step, using everything we’ve learned so far. 👉 Read here: https://lnkd.in/dSS6FHq9 #dotnet #csharp #linq #learning #programming #developers #teamlead
To view or add a comment, sign in
-
-
When you can’t decide the return type upfront — C++ lets you trail it. When you don’t know what your function’s return type will be. That’s where trailing return types step in. ⚡ Instead of declaring the return type before the function name, you place it after the parameter list — using ->. It’s not just new syntax — it’s a practical solution. Sometimes, your function’s return type depends on the parameters, and C++ can’t figure it out until after parsing them. So, you use a trailing return type to let the compiler decide what the return type should be — often through decltype or auto. That’s why it’s so common in templates and generic code. It keeps your declarations consistent and makes type deduction easier to read. Plus, it naturally aligns with lambdas, where the return type also trails the parameters. 💡 It’s C++ giving the compiler the final say — only after it’s seen what you’re working with. #cpp #cplusplus #programming #learninpublic #developers #coding #softwareengineering
To view or add a comment, sign in
-
-
Day 7 & 8 of my #90DaysOfCode Challenge The last two days were packed with learning, debugging, and building as I dove deeper into C# and object-oriented programming concepts. Day 7 Highlights: - Built a Student Management System in C#. - Added login authentication and improved user session flow. - Learned to use List<T> for flexible data storage instead of arrays. - Used int.TryParse() for input validation. - Enhanced menu navigation for a smoother user experience. Day 8 Highlights: - Practiced Polymorphism, Abstraction, and Inheritance. - Created and implemented Interfaces for multiple class behaviors. - Worked with Enums to manage constant values cleanly. - Implemented File Handling (File.WriteAllText / File.ReadAllText) for saving and reading data. - Used Exception Handling (try, catch, finally) to manage runtime errors gracefully. These lessons are giving me a strong foundation to build scalable and maintainable applications in C#. You can check out my progress here https://lnkd.in/dqK-4iGk #90DaysOfCode #CSharp #DotNet #SoftwareDevelopment #OOP #CodingJourney #Developers
To view or add a comment, sign in
-
-
Day 88 of #100DaysOfCode Today’s problem: Final Value of Variable After Performing Operations (LeetCode 2011) 🧠 Concept: Simple logic using loops and conditionals in C++ 💡 Learned how to efficiently handle string operations and use ternary operators for concise logic. Each small problem strengthens logical thinking — one step closer to mastering programming fundamentals! 🚀 #100DaysOfCode #LeetCode #Cplusplus #ProblemSolving #CodingChallenge
To view or add a comment, sign in
-
-
C++ Tip: A clean and efficient way to calculate maximum stock profit. I have seen many implementations use extra loops or complex logic for this problem. But here’s a simpler and more elegant approach track the lowest price so far and calculate profit in a single pass (O(n)). No extra space, no unnecessary conditions just clean, efficient C++ that gets the job done. #Cpp #Algorithms #CleanCode #ProblemSolving #DSA #CodingTips #Programming #DeveloperCommunity #CodeNewbie #Tech #SoftwareEngineering #CodingTips #LearnToCode #SoftwareDeveloper #TechCareer #CodeLife #100DaysOfCode #BuildInPublic
To view or add a comment, sign in
-
-
💡 C vs C++ — Understanding the Core Difference As developers, we often start our journey with C, the foundation of modern programming — a procedural language focused on functions and structured logic. Then we move to C++, an evolution that introduces Object-Oriented Programming (OOP) — bringing classes, objects, and reusability into play. Both languages are powerful in their own way: ✅ C – Fast, low-level, close to hardware ✅ C++ – Flexible, modular, and object-oriented Understanding their differences helps us appreciate how programming has evolved — from procedural thinking to object-oriented design. 🚀 #C #CPlusPlus #Programming #Developers #Coding #Learning #SoftwareDevelopment #OOP #TechEducation
To view or add a comment, sign in
-
-
Should null exist in a programming language? The short answer is - No I met a few moments that can describe my perspective: - Cowboys can’t decide which approach to use zero object or classic null handling - 10 floors null handling - Mess in the end. Code checkers show a possible null reference, but actually, it will never be null - Built-in options are a balance. It's about safety. True or false, you don’t need other states #programming #programmingLanguages
To view or add a comment, sign in
-
🔄 While vs Do-While Loops — Same Goal, Different Flow Loops are essential in programming, but choosing the right one matters for performance and logic. Here's the key difference: ♦️ While Loop Condition is checked before executing the block If condition is false initially → loop never runs ♦️ Do-While Loop Code block runs at least once Condition is checked after execution In short: ➡️ Use while when you want validation first ➡️ Use do-while when action must run at least once Mastering these basics builds confidence for writing optimized logic and cleaner programs! #ProgrammingBasics #CodingTips #WhileLoop #DoWhileLoop #Developers #SoftwareEngineering #LearnToCode #CProgramming #Java #CPlusPlus #LogicBuilding #TechEducation #GSWInfotech
To view or add a comment, sign in
-
-
The scariest bug in production? Accidentally exposing sensitive data! Don't just hope you filtered your objects. Enforce it at the type level! Here's how TypeScript's Pick utility type acts as your security guard. It lets you create a "safelist" of properties. #code #coding #programming #softwareengineering
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