Day 8 of #100DaysOfLeetCode Problem: 9. Palindrome Number Category: Math / Two Pointers / Logic Today’s problem focused on determining whether an integer reads the same backward as forward — essentially checking if a number is a palindrome. 🧠 Key Learnings: Reversed the number mathematically using modulo and integer division. Avoided converting integers to strings, focusing purely on arithmetic logic. Understood how to handle special cases like negative numbers and numbers ending with zero. Strengthened my skills in digit manipulation and loop-based reversal logic. 🎯 Takeaway: Sometimes, avoiding built-in functions helps build a deeper understanding of fundamental logic — every digit and operation counts! #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Math #LogicBuilding #Python #AIEngineer #Consistency
Solved 9. Palindrome Number with math and logic
More Relevant Posts
-
Another LeetCode problem solved: 507. Perfect Number. While the standard approach involves calculating divisors , I took a step back and looked at the constraints. For the range 1<num<10^8, there are only a handful of known Perfect Numbers (6, 28, 496...). Leveraging this mathematical insight allowed for an O(1) time complexity lookup, resulting in a 0 ms runtime and a 100% beat! This is a great reminder that efficient coding often starts with mathematical analysis, not just algorithm design. Have you ever found a great mathematical shortcut like this in a coding problem? Share your insights! 👇 #LeetCode #ProblemSolving #Algorithms #Optimization #Mathematics #Python #Coding
To view or add a comment, sign in
-
-
📌 Day 9 of My #50DaysOfPython Challenge 🐍 🔹 Task: Find the GCD (Greatest Common Divisor) using Recursion Today I explored one of the most elegant mathematical algorithms — the Euclidean Algorithm — to find the GCD (Greatest Common Divisor) of two numbers. This algorithm shows how mathematics + recursion = pure logic power 💡 🧠 What I Learned: The concept of GCD (HCF) — the largest number that divides both numbers. The Euclidean Algorithm formula: GCD(a,b)=GCD(b,a%b) This task deepened my understanding of how recursion works in mathematical logic — and how complex problems can be solved with just a few lines of clean Python code 💻 #Python #CodingChallenge #Recursion #50DaysOfPython #ProblemSolving #LearningJourney
To view or add a comment, sign in
-
Today, I experimented with a Column Transformation inside my notebook: 𝐓𝐢𝐦𝐞-𝐂𝐨𝐧𝐬𝐮𝐦𝐢𝐧𝐠 𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡 ▪ Each step is done separately: ➤ Scaling numeric columns. ➤ Imputing missing values. ➤ One-hot encoding categorical features. ➤ Ordinal encoding, etc. You have to apply each transformation individually, which takes more time and can get messy. 𝐁𝐞𝐬𝐭 𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡 ▪ Use a ColumnTransformer to handle everything in one single pipeline: ➤ Impute missing values. ➤ Apply ordinal encoding. ➤ Apply one-hot encoding. ➤ Keep other columns as-is. All transformations happen in one step, making it clean, fast, and error-free. #MachineLearning #DataScience #ColumnTransformer #sklearn #Python #HopeToSkill #LearningJourney
To view or add a comment, sign in
-
-
𝗗𝗮𝘆 𝟯𝟲 𝗼𝗳 #𝟭𝟴𝟬𝗗𝗮𝘆𝘀𝗢𝗳𝗖𝗼𝗱𝗲 Today, I solved 𝗦𝗲𝗮𝗿𝗰𝗵 𝗜𝗻𝘀𝗲𝗿𝘁 𝗣𝗼𝘀𝗶𝘁𝗶𝗼𝗻 — a practical variation of binary search. The goal was to find the index of a target in a sorted array, or the position where it should be inserted to maintain order. Using binary search, I efficiently located the correct spot in O(log n) time. The key was to track the first position where the element is greater than or equal to the target — which is exactly the insert position if the target isn’t found. This is a great example of how small tweaks to a classic algorithm can solve new problems elegantly. A useful technique for search, insertion, and maintaining sorted data dynamically! #Python #Algorithms #BinarySearch #LeetCode #Coding #ProblemSolving
To view or add a comment, sign in
-
-
Today's LeetCode problem was the foundational 509. Fibonacci Number. While there are faster ways to solve this, I focused on implementing the classic recursive solution. It's such a fundamental concept to understand, as it directly mirrors the mathematical definition: $F(n) = F(n-1) + F(n-2)$. It's a great reminder that coding is often about translating mathematical logic directly into code. The pursuit of efficiency (like using memoization next!) never stops, but understanding the basics is paramount. #LeetCode #Recursion #DSA #Algorithms #Python #ComputerScience
To view or add a comment, sign in
-
-
Day 13 of #100DaysOfLeetCode Problem: 88. Merge Sorted Array Category: Arrays / Sorting / Two Pointers Today’s challenge focused on merging two sorted arrays into one, maintaining the sorted order. It’s a simple yet powerful problem that tests your understanding of array indices, merging logic, and in-place updates. 🧠 Key Learnings: Extended the first array by adding elements from the second, then sorted the combined list. Reinforced the importance of efficient merging techniques for sorted sequences. Understood how in-place operations can reduce memory usage in practical scenarios. Strengthened logic building around sorting fundamentals and index-based insertion. 🎯 Takeaway: Even simple array problems help build strong fundamentals in sorting and data manipulation — the key to mastering larger algorithmic challenges. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Arrays #Sorting #Python #AIEngineer #Consistency
To view or add a comment, sign in
-
-
Day 5 of #100DaysOfLeetCode Problem: 54. Spiral Matrix Category: Arrays / Matrix Traversal Today’s challenge focused on traversing a 2D matrix in spiral order and returning all elements in that pattern. This problem was really fun to solve because it required handling multiple edge cases while maintaining clean traversal logic. 🧠 Key Learnings: Used the concept of repeatedly peeling off the outer layer of the matrix. Traversed top row → right column → bottom row → left column in sequence. Understood the importance of checking matrix boundaries after each step to avoid index errors. Improved logical thinking for problems involving nested data structures. 🎯 Takeaway: Matrix traversal problems are all about maintaining control over direction and boundaries — once that’s handled, the logic flows smoothly. #LeetCode #100DaysOfCode #ProblemSolving #CodingJourney #Matrix #Arrays #Python #AIEngineer #Consistency
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