🔥 Day 150 of #1000DaysOfCode — One Hundred and Fifty Days of Consistency 💥 🔗 LeetCode Profile: leetcode.com/u/Rhythan 🔗 GitHub Day 150 Code: https://lnkd.in/gvgacGhq 🧩 Problem: 633. Sum of Square Numbers Difficulty: Medium Category: Math | Two Pointers 🧠 Concept Overview: This problem explores the idea of checking if a number can be represented as the sum of squares of two integers. It’s a classic number theory problem connected to Fermat’s theorem on sums of two squares, which states that a number can be expressed as the sum of two squares if and only if every prime factor congruent to 3 mod 4 appears an even number of times. However, here we take a computational approach using two pointers — one starting from 0 and the other from √c — to efficiently verify whether such a pair exists. ⚙️ Approach Summary: Use two pointers to navigate from both ends towards the middle. Compute the sum of their squares. Adjust the pointers depending on whether the sum is smaller or greater than the target number c. This avoids unnecessary iterations and keeps the solution optimal. 💡 Key Takeaways: Combines mathematical intuition with an algorithmic mindset. Reinforces the importance of pointer-based problem-solving patterns. Showcases how math and programming often merge beautifully in problem-solving. Demonstrates consistent mastery across different topics — Binary Search, Math, and Logic. 🚀 Reflection: 150 days of focused practice. 💪 150 days of sharpening logic, discipline, and consistency. 🧩 Every solved problem adds a new layer to your confidence and coding intuition. It’s not just about solving — it’s about building momentum and mastering the art of persistence. You’re no longer just learning — you’re evolving. 🌟 ✅ Progress: Day 150 of #1000DaysOfCode Completed 📈 Consistency Level: Legendary 🔥 Next Goal: Day 200 — Keep pushing boundaries! #1000DaysOfCode #Day150 #LeetCode #MathProblems #TwoPointers #ProblemSolving #JavaDeveloper #CodingChallenge #RhythanCodes #LearnEveryday #ProgrammingJourney #DeveloperLife #AlgorithmicThinking #CodeNewbie #BuildInPublic #CodingStreak #DailyLeetCode #ConsistencyWins #CodeEveryday #Motivation #KeepLearning #NeverStopCoding #SoftwareEngineering #MathAndLogic #ChallengeYourself #Persistence #Discipline #Rhythan1000DaysChallenge
Rhythan M’s Post
More Relevant Posts
-
✅ Day 70 of #100DaysOfCode🚀 🔎 LeetCode Problem No #3354 – Count Valid Selections 🛠️ Solution - https://lnkd.in/geSxHsxD Today’s challenge was all about prefix sums, conditional counting, and state validation - testing both analytical thinking and edge-case intuition. 💡 Core Concepts Explored: Optimizing array traversal with O(n) linear scans Leveraging prefix/suffix sums for fast cumulative computations Handling decision-based iteration where each index affects multiple outcomes What made this problem interesting was identifying valid transition points dynamically without brute force - a clean example of how logical reasoning and math patterns power algorithmic efficiency. Every day of this challenge reminds me: 👉 Code is not just syntax - it’s the art of structured problem-solving. #100DaysOfCode ✅ #Day70 #LeetCode #ProblemSolving #CodingJourney #DSA #Algorithm #DataStructures #CodingChallenge #DeveloperCommunity #LearnToCode #SoftwareEngineering #CodingLife #Java #CodeNewbie #AIStudent #TechJourney #CodeEveryday #ProgrammingPractice #ProblemSolvingSkills #LeetCodeChallenge #ComputationThinking #CodeMotivation #DataScience #SoftwareDeveloper #CodeBetter #StudyWithMe #TechLearning #ProgrammersLife #BuildInPublic #StudentDeveloper #DailyCoding #SelfImprovement #MindsetMatters #CodingCommunity #LeetCodeDaily #CompetitiveProgramming #TechGrowth
To view or add a comment, sign in
-
-
Day 26 of #50DaysLeetCodeChallenge 🧩 Problem: 561. Array Partition Today’s problem was a refreshing one — an Easy-level LeetCode challenge that reinforces how sorting and pairing can optimize outcomes. It’s one of those problems that looks simple but beautifully demonstrates the power of greedy algorithms. 🧠 Thought Process: 🔹 The task is to group integers into pairs such that the sum of the smaller element in each pair is maximized. 🔹 Sorting the array ensures each pair is as balanced as possible. 🔹 Once sorted, we simply take every alternate element (starting from index 0), since that will always represent the smaller element in each optimal pair. 🔹 This method eliminates unnecessary complexity and ensures maximum total sum. ⚙️ My Approach: 🔸 Sort the array using Arrays.sort(nums). 🔸 Initialize sum = 0. 🔸 Loop through the array with a step of 2, adding nums[i] to the sum each time. 🔸 Return the final sum — the maximum possible result. 📈 Performance: ✅ Accepted ⚡ Runtime: 17 ms (Beats 13.97%) 💾 Memory: Efficient and clean implementation 💡 Reflection: Sometimes, simplicity is the key to optimization. Even without complex data structures, understanding the problem’s core logic can lead to elegant solutions. Each day’s challenge sharpens both reasoning and coding clarity. Grateful to Trainer Shishir chaurasiya and PrepInsta for guiding me through consistent, concept-driven learning in DSA 🙏 #LeetCode #50DaysLeetCodeChallenge #ProblemSolving #Java #AlgorithmDesign #CodingChallenge #PrepInsta #DeveloperJourney #LogicBuilding #DSA #CleanCode #LearningEveryday
To view or add a comment, sign in
-
-
#100DaysOfCode #Day1 #PythonProgramming I began the 100 Days of Code Challenge, and Day 1 was focused on "Working with Variables in Python to Manage Data". It was mostly an introduction to Python, and I got to practice debugging, learn the syntax, and even build a simple band name generator using variables and string concatenation. Here are some reflections from Day 1's lectures: ✅ Consistency beats intensity. Success comes to those who show up. It’s not about doing everything at once, but about showing up daily, even when motivation fades. Progress rewards presence. ✅ Steve Martin once said, “Be so good that they can’t ignore you.” That line hit differently today. Excellence has a voice of its own. When you commit to mastering your craft, recognition becomes a byproduct, not the goal. ✅ Success, I’ve learned, is measured in steps, not miles. In coding and in life, momentum is built one function, one commit, one small win at a time. ✅ Coding is like history; you don’t need to memorize everything. It’s also like baking; you don’t need to remember every recipe, just understand why each ingredient matters. The goal isn’t memorization, it’s comprehension. ✅ All programmers make mistakes. What separates the great ones is how they handle them. Personally, I believe programming is 80% thinking and 20% typing. Most of the work happens in the mind, analyzing, structuring, and simplifying. The code is simply the final expression of clear thought. ✅ Communities like Stack Overflow, forums, and documentation are goldmines. You’re never coding alone. Someone, somewhere, has faced the exact problem you’re dealing with. Learning to ask good questions is just as important as writing good code. ✅ Lastly, AI should enhance your efficiency, not replace your understanding. The better you grasp the foundations, the more powerful these tools become. The goal isn’t to depend on them, it’s to work with them. Day 1 done ✅ On to Day 2!
To view or add a comment, sign in
-
-
LeetCode is HARD until you learn these 15 Patterns: 1. Prefix Sum 2. Two Pointers 3. Sliding Window 4. Fast & Slow Pointers 5. LinkedList In-place Reversal 6. Monotonic Stack 7. Top ‘K’ Elements 8. Overlapping Intervals 9. Modified Binary Search 10. Binary Tree Traversal 11. Depth-First Search (DFS) 12. Breadth-First Search (BFS) 13. Matrix Traversal 14. Backtracking 15. Dynamic Programming Patterns 📞 Learn more: https://lnkd.in/dj6YdNnB #AgenticAI #AIOrchestration #LLMAgents #Alchemy #AIFutureOfWork #AIProductManagement #BuildWithAI #AlchemyWithAsh #ResponsibleAI #TechWithHeart #InnovationMindset #Coding #softwareengineer #github #leetcode #FAANG #Microsoft
To view or add a comment, sign in
-
-
🥷 Day 164 of My 365 LeetCode Challenge is done! 💥 Kicked off strong, solved my problem, and the coding vibe is awesome! 🧠 💡 LeetCode 1625 — Lexicographically Smallest String After Applying Operations Today’s challenge was an interesting blend of string manipulation, BFS traversal, and modular arithmetic — the kind of problem that truly sharpens both your algorithmic thinking and pattern recognition skills. 🧠✨ We’re given a numeric string s and two integers a and b. Two operations can be performed repeatedly in any order: 1️⃣ Add a to all digits at odd indices (with digits wrapping around modulo 10). 2️⃣ Rotate the string to the right by b positions. The goal? 🔍 Find the lexicographically smallest string possible after performing any number of these operations. Sounds simple, right? But here’s the catch — since operations can be performed infinitely, the problem hides a state-space exploration challenge. The same string can appear multiple times via different paths, so blindly iterating could easily lead to infinite loops or redundant computations. ⚙️ Approach & Thought Process: To systematically explore all possible transformations, I used Breadth-First Search (BFS) — perfect for enumerating all reachable states in minimal steps. 🔸 Step 1: Start from the original string and push it into a queue. 🔸 Step 2: For each string, perform both allowed operations: - Add a to digits at odd indices (handling digit wraparound using (digit + a) % 10). - Rotate the string by b positions. 🔸 Step 3: Use a set to track all previously visited strings to prevent cycles. 🔸 Step 4: Continuously compare and update the smallest lexicographic string seen so far. Once the queue is exhausted, the smallest recorded string is our answer ✅ 🔥 Key Learning: This problem elegantly demonstrates how graph traversal (BFS) can be applied beyond traditional graphs — even on state transformations of strings. Recognizing this pattern is a huge step toward mastering advanced algorithmic thinking. ✨ Every problem like this one is a reminder that great coding isn’t about memorizing — it’s about seeing structure where others see chaos. #LeetCode #CPlusPlus #CodingChallenge #ProblemSolving #Algorithms #BFS #SoftwareEngineering #Programming #LearningJourney #CodeNewbie #DataStructures
To view or add a comment, sign in
-
-
🔁 Ever tried to understand Recursion — but felt like you’re looping forever? Let’s break it down once and for all 👇 --- 🧠 What is Recursion? Recursion is when a function calls itself to solve smaller versions of the same problem — until it reaches a base case. Think of it like standing between two mirrors — the reflection goes deeper and deeper, but there’s always a point where it stops. That stopping point is your base case! --- 💡 Real-World Example: You open a stack of nested boxes. Each box contains another box — until the final one has your gift. To get it, you open the top box (call the function), find another box inside (recursive call), and repeat — until you reach the last box (base case). Then you close each box back as the function returns! --- ⚙️ Simple Code: int factorial(int n) { if (n == 0) return 1; // base case return n * factorial(n - 1); // recursive call } --- 🪄 Why It’s Powerful: Makes complex problems simpler Foundation for divide and conquer algorithms Used in backtracking, tree traversal, dynamic programming, and more --- ⚠️ Quick Tip: Always define your base case properly — otherwise, recursion becomes an infinite loop 🔄 --- 🚀 In short: > “Recursion is thinking smaller to solve bigger.” --- Resources 💡 Resources to Learn Recursion 🎓 Beginner-Friendly Tutorials 1. GeeksforGeeks – Recursion Basics ➜ https://lnkd.in/dAK6p8Hi Covers everything from base case, recursive case, and call stack visualization. 2. Programiz – Learn Recursion in C, C++, Python ➜ https://lnkd.in/d_ZSWQ6m Great for code examples and visualization for beginners. If have any queries comment down 👇 #Recursion #ProgrammingConcepts #DSA #CodeLearning #CProgramming #Developers #LogicBuilding #ComputerScience #TechLearning #LearnByDoing #Sarvastrix #Coding
To view or add a comment, sign in
-
-
🌟 **Day 2 of My Rust Journey: Variables, Mutability & Shadowing** 🌟 Today, I dove into one of the most crucial fundamentals in Rust — how variables work. If you’re transitioning from another programming language, Rust’s strict rules around variables might catch you off guard! --- **1️⃣ Immutable by Default** In Rust, every variable is *immutable* by default unless you mark it as mutable. This means once you assign a value, you can’t change it later. ```rust fn main() { let x = 5; println!("x = {x}"); // x = 6; // ❌ compile-time error } ``` Rust ensures safety from the get-go, leading to fewer runtime surprises. 🎯 --- **2️⃣ Making Variables Mutable** Want to modify a variable? Just add the `mut` keyword! ```rust fn main() { let mut count = 1; count += 1; println!("count = {count}"); } ``` This clearly signals to Rust that you intend to change the value. 🛠️ --- **3️⃣ Shadowing (Declaring Same Name Again)** Shadowing allows you to reuse a variable name with a new value or even a new type. ```rust fn main() { let spaces = " "; let spaces = spaces.len(); println!("spaces = {spaces}"); } ``` Each `let` creates a *new* variable, enabling safe and powerful data transformations. 💡 --- **💡 Key Takeaway** Rust encourages you to think critically about *when* and *why* values should change. The concepts of mutability and shadowing enhance code clarity and intentionality, eliminating silent state changes. ✨ Tomorrow, I’ll dive into **Rust Data Types (integers, floats, booleans, chars)**. Stay tuned! #Rust #100DaysOfRust #LearningRust #ProgrammingJourney #SoftwareEngineering #Coding #Developers #TechTalks #Innovation #ProgrammingCommunity --- Excited to continue this journey and share my learnings with you all! What are your thoughts on Rust’s approach to variables? 🤔💬
To view or add a comment, sign in
-
You will never be able to learn everything in tech. But if you learn how to learn, you will never fall behind. A senior engineer once told me this: At first, I laughed. Then React updated. Python released a new version. And suddenly… I wasn’t laughing anymore. 😅 That’s when I stopped trying to be the framework collector and started focusing on what actually mattered: 1. Understanding what and why behind tools, not just memorizing syntax. 2. Learning deeply instead of knowing 10 things halfway. 3. Building projects because debugging your own code teaches more than 50 tutorials ever will. Now, when new tech drops, I don’t panic. I just say, “Cool, give me a weekend,” and figure it out. In a world that changes every sprint, adaptability is your real tech stack. #SoftwareEngineering #tech #coding
To view or add a comment, sign in
-
-
💡 𝐃𝐚𝐲 𝟔 𝐨𝐟 #𝟏𝟎𝟎𝐃𝐚𝐲𝐬𝟏𝟎𝟎𝐓𝐨𝐨𝐥𝐬 𝐓𝐨𝐝𝐚𝐲’𝐬 𝐭𝐨𝐨𝐥: Exercism → https://exercism.org/ 𝐖𝐡𝐚𝐭 𝐢𝐬 𝐢𝐭? Exercism is a free, community-driven learning platform offering hundreds of practical coding exercises across 70+ programming languages — with the added bonus of human mentors reviewing your work. 𝐖𝐡𝐲 𝐈 𝐥𝐢𝐤𝐞 𝐢𝐭? It complements cheat-sheet sites (like QuickRef.ME from yesterday) by going from “look up syntax fast” to “practice what you just learned and get feedback”. Covers a broad spectrum of languages and has beginner-friendly tracks plus more advanced ones. The mentorship element helps you go beyond rote answers — you learn the idiomatic way to write code in that language. 𝐐𝐮𝐢𝐜𝐤 𝐭𝐢𝐩: If you used QuickRef.ME to refresh a command or syntax yesterday, jump into Exercism today: pick that same language (for example: Python or JavaScript), start one exercise from the track, submit it and review the feedback. It closes the loop between “look up” → “apply” → “improve”. Have you used Exercism (or similar platforms) before? Drop your experience below 👇 Stay tuned for Tool #7 tomorrow! #100Days100Tools #ToolOfTheDay #LearningTools #CodePractice #DevTools #Programming
To view or add a comment, sign in
-
-
🗓 Day 11 / 100 – #100DaysOfLeetCode 📌 Problem 2536: Increment Submatrices by One The task was to apply multiple increment operations on submatrices of an n × n grid and return the final updated matrix. 🧠 My Approach: Used a 2D difference matrix to avoid incrementing each cell individually. Updated only the boundaries for each operation to keep the process efficient. Applied a 2D prefix sum after all operations to reconstruct the final matrix. This method is scalable and avoids repetitive nested loops. 💡 Key Learning: This problem emphasized the power of difference arrays and prefix sums — techniques that transform heavy matrix operations into clean, optimized solutions. These patterns are widely used in competitive programming, segment trees, and efficient grid-based algorithms. Every new problem strengthens both technique and intuition 🚀 #100DaysOfLeetCode #LeetCodeChallenge #Python #ProblemSolving #Coding #DataStructures #Algorithms #DSA #Matrix #PrefixSum #DifferenceArray #CompetitiveProgramming #LeetCode #Tech #Programming #SoftwareEngineering #CodeNewbie #DeveloperJourney #TechStudent #CSE #DataScience #CodeEveryday #LearnToCode #CodingCommunity #CareerGrowth #Optimization #LogicBuilding #ComputerScience #StudentsWhoCode #KeepLearning #Programmer #EngineerLife #TechCareer #CodeLife
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