💻 Day 76 of #100DaysOfCoding Today’s problem was “Check If Digits Are Equal in String After Operations I” (LeetCode – Easy). The task was to repeatedly sum each pair of consecutive digits (mod 10) until the string becomes exactly two digits long and then check if both are equal. I used a simple and clear approach with a while loop and StringBuilder, updating the string in each iteration until it reduced to two digits. It’s a great example of how small logical patterns can make an otherwise repetitive problem neat and efficient ✨ #100DaysOfCoding #LeetCode #CodingJourney #ProblemSolving #Java #CodeEveryday #DSA #WomenInTech #SoftwareEngineering #LearningInPublic
Solved LeetCode problem with simple Java code
More Relevant Posts
-
Day 2 of #251DaysOfDSA 🚀 Problem: Palindrome Number Time Complexity: O(log₁₀n) Space Complexity: O(1) ✨ What I learned: I learned how to check if a number reads the same backward as forward without converting it entirely into a string. The key idea is to reverse half of the number and compare it with the remaining half — simple yet efficient! #LeetCode #DSA #Java #251DaysOfDSA #CodingJourney #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 57/100 of #100DaysOfLeetCode Today’s problem was 1323. Maximum 69 Number 💡 The task was to maximize a given positive integer (consisting only of digits 6 and 9) by changing at most one digit — specifically, changing a 6 to a 9 to get the largest possible number. 🔑 Key Takeaways: Learned how to efficiently manipulate numbers as strings. #LeetCode #Day57 #Java #100DaysOfCode #ProblemSolving #CodingChallenge #LearningEveryday
To view or add a comment, sign in
-
-
🚀 Day 7️⃣7️⃣ of #100DaysOfCode Solved LeetCode Problem #1437 — Check If All 1’s Are at Least K Places Away 🔍✨ 🔧 Concept: Given a binary array, ensure that every 1 is separated by at least K zeros. The solution simply tracks the previous index of 1 and checks the distance. 🧠 Key Idea: Scan the array once When a 1 is found, verify: 👉 currentIndex - previousIndex > k If any pair violates this, return false ⚡ Efficient: Time Complexity: O(n) Space Complexity: O(1) Another clean and efficient logical problem solved. #LeetCode #Java #Arrays #ProblemSolving #DSA #CodingJourney #100DaysOfCode #DeveloperLife #Motivation
To view or add a comment, sign in
-
-
🚀 Day 6/60 — #60DaysDSAChallenge Today's question: Check if a String is Palindrome or Not 🔄 Concept: A palindrome is a string that reads the same backward as forward — like madam, level, or racecar. 📚 What I learned: • How to compare characters from both ends of a string • Improved my understanding of string manipulation • Focused on writing clean and simple logic Small progress every day adds up to big results 🚀 #DSA #Java #CodingJourney #ProblemSolving #Consistency #LearnCoding #DSAChallenge #60DaysDSAChallenge
To view or add a comment, sign in
-
-
🚀 𝐃𝐚𝐲 9 𝐨𝐟 𝐦𝐲 #100𝐃𝐚𝐲𝐬𝐎𝐟𝐃𝐒𝐀 𝐉𝐨𝐮𝐫𝐧𝐞𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦𝐬 𝐒𝐨𝐥𝐯𝐞𝐝 𝐓𝐨𝐝𝐚𝐲 : 🔥 1️⃣ Leetcode (Medium) – Product of Array Except Self 💡 Key Idea: Instead of using division, use Prefix and Suffix Products. Prefix → product of all elements before the current index Suffix → product of all elements after the current index Multiply both to get the result for each element. 🧾 Time Complexity: O(n) ⚙️ Space Complexity: O(1) #DSA #Java #100DaysOfCode #ProblemSolving #LearningInPublic #SortingAlgorithms #CodingJourney
To view or add a comment, sign in
-
-
🌳 Day 46 of #LeetCodeJourney Problem: 100. Same Tree ✅ Today’s challenge was about comparing two binary trees — checking if they’re structurally identical and have the same node values. A neat recursive problem that refreshes the basics of tree traversal and recursion! 💡 Key takeaway: If you can break a problem down into smaller identical subproblems — recursion will always have your back. #LeetCode #100DaysOfCode #Java #DSA #BinaryTree #Recursion #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 33 of My Daily Coding Challenge 🚀 Today I implemented and revised Cyclic Sort (Java) — one of the most efficient sorting techniques for arrays containing numbers from 1 to N. 💡 Key takeaway: Instead of comparing adjacent elements, Cyclic Sort keeps placing each number at its correct index — making it super fast for such problems. 🔗 Solution: [https://lnkd.in/epUjThMt] Building consistency, one algorithm at a time 💻💪 #DailyCodingChallenge #Java #DSA #CyclicSort #SortingAlgorithms #100DaysOfCode #LearningEveryday
To view or add a comment, sign in
-
-
📌 Day 3/100 - Remove Duplicates from Sorted Array (LeetCode 26) 🔹 Problem: Given a sorted array, remove the duplicates in-place so that each element appears only once and return the new length. You must modify the array without using extra space for another array. 🔹 Approach: I used a simple counting-based approach: Iterate through the array using a single loop. If the current element is the same as the next, skip it. Otherwise, place it at the current count index and increment count. Finally, return count as the number of unique elements. 🔹 Key Learning: Practiced in-place array modification efficiently without extra space. Improved understanding of loop-based filtering logic. Realized that sometimes the simplest linear approach works best! Consistency compounds — each problem adds a new layer of confidence! 🚀#100DaysOfCode #LeetCode #Java #ProblemSolving #Array #DSA #TwoPointers
To view or add a comment, sign in
-
-
✨ Day 26 🚀– #LeetCode Challenge ✨ 📘 Topic: Contains Duplicates https://lnkd.in/gVKGx5uP Today’s problem was all about checking whether an array has duplicate elements or not. 🔍 Concept Used: HashSet (or HashMap) for quick lookup Focus on time efficiency (O(n) complexity) 💡 Key Takeaway: Using a Set helps in identifying duplicates efficiently since it stores only unique values. 🧠 Logic Summary: Traverse through the array Add elements to a set If an element already exists → duplicate found ✅ #Day26 #LeetCode #30DaysOfCode #ProblemSolving #Java #CodingJourney #ContainsDuplicates #DataStructures #HashSet
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