🚀 Day 13/100 ✅ : Binary addition Tackled the binary-string addition problem in Java today. Here’s what stood out: ⏱ Time Complexity: O(max(n, m)) — we visit each bit exactly once. ✨ Key Strengths: handles different lengths, propagates carry correctly, and avoids overflow. I’m always looking to write code that’s not just correct, but clean and efficient. 💡 What’s one small improvement you made today in your code? Share below! 👇 #100DaysOfCode #Java #Algorithms #CodeQuality #GrowthMindset
"Mastered binary addition in Java with O(max(n, m)) time complexity"
More Relevant Posts
-
🚀 Day 68 of My #100DaysOfCode Challenge ✅ Problem: Maximum Number of Distinct Elements After Operations (LeetCode #3397) 📘 Language: Java 📈 Difficulty: Medium Today’s challenge was about optimizing distinct elements in an array when you’re allowed to modify each element within a range [-k, k]. 🔍 Approach: Sort the array to handle elements in increasing order. Use a greedy strategy: for each number, pick the smallest possible distinct value within [x - k, x + k] that hasn’t been used before. Keep track of the previous chosen value to ensure uniqueness. 💡 Key Insight: Sorting + Greedy = Simple and efficient! This ensures minimal overlap and maximum distinctness. ⏱️ Runtime: 19 ms (Beats 84.14%) 💾 Memory: 58.00 MB (Beats 73.79%) Every day, one step closer to mastering algorithmic thinking 💪 #LeetCode #Java #ProblemSolving #100DaysOfCode #CodingJourney #SoftwareEngineering
To view or add a comment, sign in
-
-
Day 13 of LeetCode Grind Problem: 2598. Smallest Missing Non-negative Integer After Operations (Medium) Language: Java This was an interesting MEX-based problem where you can modify elements by repeatedly adding or subtracting a fixed value. The key insight is that every number falls into a remainder bucket based on value. If you know how many times each remainder appears, you can greedily construct the MEX. Learned once again: Thinking in terms of frequency + modulo groups can simplify many "operation-based" problems. #LeetCode #LeetCodeDaily #100DaysOfCode #Java #ProblemSolving #DataStructures #Algorithms #MathInDSA #CodingJourney #InterviewPrep
To view or add a comment, sign in
-
-
💻 Day 45 of #LeetCode Journey 🚀 ✅ Problem: Count and Say 📘 Language: Java 🔹 Status: Accepted (30/30 test cases passed) 🔹 Runtime: 4 ms | Beats 55.38% 🔹 Memory: 41.86 MB 🧠 Concept: This problem is about generating the n-th term in the “count and say” sequence. Each term is built by describing the previous term — count the number of digits and say them in order. 🧩 Approach: Start with "1". For each iteration, use a StringBuilder to construct the next sequence. Track consecutive digits using a counter. Append the count and digit when the sequence changes. 💡 Efficient string manipulation and iteration give optimal performance. 🔥 Every solved problem builds confidence. One step closer to mastering patterns in strings! #Day45 #LeetCode #Java #CodingChallenge #ProblemSolving #CountAndSay #50DaysOfCode
To view or add a comment, sign in
-
-
Problem: Final Value of Variable After Performing Operations Difficulty: Easy Sometimes coding challenges are not about complex algorithms — they’re about writing clean, readable logic. Today’s problem gives a list of increment/decrement operations (++X, X++, --X, X--) and asks to compute the final value of a variable starting from 0. Simple? Yes. But it's a good reminder that clarity > cleverness. #Day17 #LeetCode #Java #BeginnerFriendly #Consistency #100DaysOfCode #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 89 of #100DaysOfLeetCode 🚀 Today’s problem: Plus One ➕ In this problem, the goal is to increment a large integer represented as an array of digits by one. It’s a simple-sounding task but highlights how important it is to handle carry-over logic correctly — especially when the last digits are 9s (e.g., [9,9,9] → [1,0,0,0]). The main challenge was to iterate through the digits from right to left, manage the carry efficiently, and ensure that the solution works for all edge cases without using string conversion. ✅ Key learnings: Array manipulation Handling carry in arithmetic operations Edge case management (all digits being 9) 💻 Language: Java ⚡ Result: Accepted | Runtime: 0ms (Beats 100%) Each problem, no matter how simple it looks, strengthens logical thinking and attention to detail — one step closer to mastering problem-solving! 💪 #LeetCode #100DaysOfCode #ProblemSolving #CodingChallenge #Java #LearningEveryday
To view or add a comment, sign in
-
-
Day 89 of #100DaysOfCode Solved Find Numbers with Even Number of Digits in Java 🔢 Approach The goal of this problem was to count how many integers in a given array have an even number of digits. I implemented two methods: findNumbers(int[] nums): This is the main function that iterates through every number in the input array nums. isEvenOrOdd(int n): This helper function takes an integer and determines if its digit count is even or odd. Inside the helper function, I used a while loop to count the digits: I initialized a count to 0. The loop continues as long as $n > 0$. In each iteration, I increment count and then perform integer division by 10 (n = n / 10) to remove the least significant digit. Finally, I return true if the total count of digits is even (count \% 2 == 0). This efficient, digit-by-digit checking approach resulted in a strong performance, beating 98.90% of other submissions. #Java #100DaysOfCode #LeetCode #CodingChallenge #Algorithms #Array #ProblemSolving #Optimization
To view or add a comment, sign in
-
-
Just solved a simple yet foundational Prefix Sum problem — “Running Sum of 1D Array”. This question helps build a strong base for understanding prefix sums, which play a key role in solving many range sum and subarray problems efficiently. ✅ Time Complexity: O(n) ✅ Space Complexity: O(1) ✅ Beats 100% Runtime on LeetCode! Small wins like these remind me that even “easy” problems are essential stepping stones to mastering algorithmic thinking 💪 #LeetCode #CodingJourney #DSA #Java #PrefixSum #100Percent
To view or add a comment, sign in
-
-
🚀 Day 20 of #100DaysOfLeetCode 💡 Problem: Gray Code Today’s challenge was all about generating the Gray Code sequence, a fascinating binary numbering system where only one bit changes between consecutive numbers. 🧠 Concept: Gray codes are widely used in digital communication and error correction, ensuring minimal transition errors between binary states. 🔍 Key takeaway: Bit manipulation + recursion = elegant solution ✨ 💻 Languages used: Java #LeetCode #100DaysOfCode #ProblemSolving #CodingChallenge #Java #GrayCode #DSA #BitManipulation
To view or add a comment, sign in
-
-
Day 66 of #100DaysOfLeetCode 💡 ✅ Problem: 2598. Smallest Missing Non-negative Integer After Operations 🧠 Concept: Modular arithmetic + frequency mapping In this problem, I learned how to utilize modular patterns to track occurrences efficiently — instead of brute-forcing through every possibility. A smart way to find the maximum possible MEX by observing patterns in remainders! 💻 Language: Java ⚡ Runtime: 5 ms (Beats 97.97%) Small optimizations can make a huge difference in algorithmic performance 🚀 #LeetCode #ProblemSolving #100DaysOfCode #Java #DSA #CodingJourney #WomenInTech
To view or add a comment, sign in
-
-
Day-87 "Just solved the Fizz Buzz problem on LeetCode! 🚀 Implemented a Java solution that got accepted with a runtime of 1ms, beating 99.66% of submissions. 💻 Coding problems like these are great for sharpening problem-solving skills. - *Performance Metrics*: - Runtime: 1 ms (beats 99.66%). - Memory: 45.10 MB (beats 80.21%). - *Code*: - Written in Java. - Implements Fizz Buzz logic for numbers 1 to n. - *Test Result*: - Input: n = 3. - Output: ["1", "2", "Fizz"]. #FizzBuzz #LeetCode #Coding #ProblemSolving #Java"
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