🚀 Another LeetCode Problem Solved: Palindrome Number! 🔗 Check out my solution: https://lnkd.in/dwDMqXXn 💡 Problem Overview Given an integer x, determine whether it is a palindrome — meaning it reads the same forward and backward. (LeetCode) Examples: ✔ 121 → Palindrome ❌ -121 → Not a palindrome ❌ 10 → Not a palindrome 🧠 My Approach (Digit Reversal) Instead of converting the number to a string, I used a mathematical approach: Extract digits using % 10 Reverse the number step by step Compare reversed number with original ⚙️ Key Learnings ✔ Strong understanding of number manipulation ✔ Importance of handling edge cases (negative numbers, trailing zeros) (leet-solution.com) ✔ Practicing clean and efficient logic ⏱️ Complexity • Time Complexity: O(log n) • Space Complexity: O(1) 🔥 Why this problem matters Even though it’s an “easy” problem, it builds: Logical thinking Problem-solving fundamentals Confidence for bigger challenges #LeetCode #DSA #Python #CodingJourney #ProblemSolving #100DaysOfCode
Palindrome Number Solution on LeetCode
More Relevant Posts
-
🚀 Another LeetCode Problem Solved: Palindrome Number! 🔗 Check out my solution: https://lnkd.in/dwDMqXXn 💡 Problem Overview Given an integer x, determine whether it is a palindrome — meaning it reads the same forward and backward. (LeetCode) Examples: ✔ 121 → Palindrome ❌ -121 → Not a palindrome ❌ 10 → Not a palindrome 🧠 My Approach (Digit Reversal) Instead of converting the number to a string, I used a mathematical approach: Extract digits using % 10 Reverse the number step by step Compare reversed number with original ⚙️ Key Learnings ✔ Strong understanding of number manipulation ✔ Importance of handling edge cases (negative numbers, trailing zeros) (leet-solution.com) ✔ Practicing clean and efficient logic ⏱️ Complexity • Time Complexity: O(log n) • Space Complexity: O(1) 🔥 Why this problem matters Even though it’s an “easy” problem, it builds: Logical thinking Problem-solving fundamentals Confidence for bigger challenges 🚀 Next Goal Move towards optimized approaches and medium-level problems to strengthen DSA skills. #LeetCode #DSA #Python #CodingJourney #ProblemSolving #100DaysOfCode
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
-
-
Today Development Seed published v0.1.0 of lazycogs: a flexible tool for loading STAC collections as lazy mosaicked arrays in xarray. Inspired by stackstac and odc-stac, lazycogs uses stac-geoparquet as a metadata backend and async-geotiff + obstore for all data i/o. It allows you to define the target coordinate reference system, extent, and resolution then it uses rustac to query a stac-geoparquet dataset (local or remote) to locate the assets that are relevant for spatial/temporal subsets. When you actually want to load some pixels it fetches only the bytes you need from the cloud-optimized geotiff assets. https://lnkd.in/gZZsWJpa If you work with STAC and COGs in Python, give it a try and let me know how it goes! The image below is a low-cloud 300 meter Sentinel 2 L2A mosaic from May 2025 for the Southwest US that combines assets from hundreds of STAC items.
To view or add a comment, sign in
-
-
Really excited about Henry Rodman's work on lazycogs! It's an efficient way to lazily create an xarray DataArray of a big stack of COGs Now let's see about getting this integrated with lonboard 🙂↕️
Today Development Seed published v0.1.0 of lazycogs: a flexible tool for loading STAC collections as lazy mosaicked arrays in xarray. Inspired by stackstac and odc-stac, lazycogs uses stac-geoparquet as a metadata backend and async-geotiff + obstore for all data i/o. It allows you to define the target coordinate reference system, extent, and resolution then it uses rustac to query a stac-geoparquet dataset (local or remote) to locate the assets that are relevant for spatial/temporal subsets. When you actually want to load some pixels it fetches only the bytes you need from the cloud-optimized geotiff assets. https://lnkd.in/gZZsWJpa If you work with STAC and COGs in Python, give it a try and let me know how it goes! The image below is a low-cloud 300 meter Sentinel 2 L2A mosaic from May 2025 for the Southwest US that combines assets from hundreds of STAC items.
To view or add a comment, sign in
-
-
🗓 7 April 2026 🚀 LeetCode #703 – Kth Largest Element in a Stream Solved this problem using a clean and efficient Min Heap approach 🔥 💡 Instead of storing all elements, I maintained only the top K largest elements, which makes the solution scalable for large data streams. 🧠 Approach: • Created a min heap • Added elements in the constructor • If size exceeds k → removed the smallest element • In add(): – Push new value into heap – Pop if size exceeds k – Return the top element (Kth ) ⚡ Time Complexity: O(n log k) 📦 Space Complexity: O(k) 💭 Key Insight: We don’t need to store all elements — just maintain the top k elements. The smallest among them is the answer 🎯 #LeetCode #DSA #Python #Coding #100DaysOfCode #Heap
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
-
-
📌 Problem: 1679. Max Number of K-Sum Pairs 💡 Approach: First, sort the array to efficiently apply the two-pointer technique. Initialize two pointers: one at the start (left) and one at the end (right). If the sum equals k, we found a valid pair → increment count and move both pointers If the sum is greater than k, move the right pointer to reduce the sum If the sum is smaller than k, move the left pointer to increase the sum Continue until both pointers meet. ⚙️ Key Insight: Sorting enables efficient pair finding Two-pointer approach avoids checking all pairs (O(n²)) Greedy selection ensures maximum number of operations ⏱️ Time Complexity: O(n log n) (due to sorting) 📦 Space Complexity: O(1) (ignoring sorting space) 📚 What I learned: Two-pointer technique on sorted arrays Optimizing pair problems from brute force to efficient solutions #LeetCode #DSA #Algorithms #Coding #ProblemSolving #Python #TwoPointers #Greedy #InterviewPreparation #CodingJourney
To view or add a comment, sign in
-
🚀 Day 39/60 — LeetCode Discipline Problem Solved: Sqrt(x) Difficulty: Easy Today’s challenge was to compute the square root of a number without using built-in functions. Instead of brute force, I used Binary Search — a classic, elegant approach that narrows down the answer efficiently. 💡 Key Learnings: • Binary Search application beyond arrays • Handling edge cases (x < 2) • Avoiding overflow using conditions carefully • Finding floor value of square root • Optimized thinking over brute force ⚡ Performance: Runtime: 4 ms Like walking in a foggy path, I didn’t see the answer directly… But step by step— cutting the search space in half— the truth revealed itself. That’s the beauty of algorithms. #LeetCode #60DaysOfCode #DSA #BinarySearch #ProblemSolving #CodingJourney #Python #Consistency #TechGrowth
To view or add a comment, sign in
-
-
Turbovec is now available on PyPi 🐍 and Crates.io 📦 Turbovec is a vector index built on Google's TurboQuant algorithm, written in Rust with Python bindings. Turbovec has identical or better speed, compression and recall compared to Faiss while also being data-oblivious. Because adding new vectors doesn't require re-indexing, Turbovec is dramatically simpler to operate in production. → pip install turbovec → cargo add turbovec Check out the open-source repo: https://lnkd.in/e5M4dVRk #RAG #LLM #OpenSource #Gemma4
To view or add a comment, sign in
-
-
🚀 Day 96 of #LeetCode Journey 📌 Problem: Count and Say (Medium) Today’s problem looked simple at first glance—but it quickly tested my ability to observe patterns and think recursively. 🔍 Key Idea: The sequence builds itself by describing the previous term: - Start with "1" - Then keep "reading" the digits of the last result Example progression: 1 → "1" 2 → "11" (one 1) 3 → "21" (two 1s) 4 → "1211" (one 2, one 1) 💡 What I learned: - This problem is all about pattern recognition + string manipulation - It’s essentially run-length encoding (RLE) - Breaking the problem into a helper logic made it much cleaner ⚡ Challenges faced: - Handling consecutive characters correctly - Avoiding off-by-one mistakes while traversing - Keeping the logic readable instead of overcomplicating 📈 Outcome: ✅ Accepted ⚡ Runtime: 7 ms Consistency > Motivation. Showing up every day. #Day96 #LeetCode #DSA #ProblemSolving #CodingJourney #Python #Consistency
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