Day 75 of #100DaysOfLeetCode 💻✅ Solved #278. First Bad Version problem in Java. Approach: • Used Binary Search to minimize API calls • Narrowed search space using isBadVersion(mid) • Moved left/right pointers based on condition • Final position gives the first bad version Performance: ✓ Runtime: 16 ms (Beats 10.29% submissions) ✓ Memory: 42.16 MB (Beats 42.59% submissions) Key Learning: ✓ Practiced Binary Search with API-based problems ✓ Improved optimization by reducing unnecessary calls ✓ Strengthened problem-solving using monotonic conditions Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearch #ProblemSolving #CodingJourney #100DaysOfCode
Solved LeetCode #278 with Binary Search in Java
More Relevant Posts
-
Day 62 of #100DaysOfLeetCode 💻✅ Solved #219. Contains Duplicate II problem in Java. Approach: • Used two nested loops to compare elements within range k • For each element, checked next k elements • If any duplicate is found within distance k, returned true • If no such pair exists, returned false Key Learning: ✓ Practiced checking duplicates within a given range ✓ Strengthened understanding of array traversal with conditions ✓ Learned the importance of optimizing nested loop solutions Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 70 of #100DaysOfLeetCode 💻✅ Solved #3136. Valid Word problem in Java. Approach: • Checked if the word length is at least 3 • Traversed each character in the string • Ensured all characters are either letters or digits • Checked for presence of at least one vowel • Checked for presence of at least one consonant • Returned true only if all conditions are satisfied Performance: ✓ Runtime: 1 ms (Beats 99.62% submissions) 🚀 ✓ Memory: 43.08 MB (Beats 93.16% submissions) Key Learning: ✓ Practiced string validation with multiple conditions ✓ Learned efficient use of built-in character functions ✓ Strengthened logic building for edge case handling Learning one problem every single day 🚀 #Java #LeetCode #DSA #Strings #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 89 of #100DaysOfLeetCode 💻✅ Solved #15. 3Sum problem in Java. Approach: • Sorted the array first • Fixed one element and used Two Pointers for the rest • Skipped duplicates to avoid repeated triplets • Adjusted pointers based on sum comparison Performance: ✓ Runtime: 30 ms (Beats 87.77% submissions) ✓ Memory: 59.02 MB (Beats 77.30% submissions) Key Learning: ✓ Mastered Two Pointer technique with sorting ✓ Learned handling duplicates efficiently ✓ Improved problem-solving for combination-based problems Learning one problem every single day 🚀 #Java #LeetCode #DSA #TwoPointers #Arrays #Sorting #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 58/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 278. First Bad Version Used binary search on answer space to efficiently find the first bad version while minimizing API calls. ⏱️ Time Complexity: O(log n) 📦 Space Complexity: O(1) Strengthening understanding of binary search optimization and decision-based problems. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day 88 - LeetCode Journey Solved LeetCode 24: Swap Nodes in Pairs in Java ✅ This problem is a great exercise in pointer manipulation in linked lists. Instead of changing values, I swapped the actual nodes by carefully adjusting the next pointers. Using a dummy node made the process much cleaner and helped handle edge cases smoothly. Step by step, I swapped pairs while moving forward in the list. Key takeaways: • Deep understanding of pointer manipulation • Importance of dummy node in linked list problems • Clean handling of edge cases • Iterative approach for swapping nodes ✅ All test cases passed ⚡ Efficient O(n) time and O(1) space Linked list problems like this really sharpen your fundamentals 🔥 #LeetCode #DSA #Java #LinkedList #Pointers #ProblemSolving #CodingJourney #InterviewPrep #Consistency #100DaysOfCode
To view or add a comment, sign in
-
-
Day 72 of #100DaysOfLeetCode 💻✅ Solved #3866 “First Unique Even Element” problem in Java. Approach: • Traversed the array to find even numbers • For each even number, counted its occurrences in the array • If the count is exactly 1, returned that number • Continued until the first unique even number is found • Returned -1 if no such number exists Performance: ✓ Runtime: 1 ms (Beats 99.36% submissions) 🚀 ✓ Memory: 45.15 MB (Beats 98.39% submissions) Key Learning: ✓ Practiced combining conditions (even + uniqueness) ✓ Improved understanding of nested loop logic ✓ Learned how to filter and validate elements efficiently Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 63 of #100DaysOfLeetCode 💻✅ Solved #2085. Count Common Words With One Occurrence problem in Java. Approach: • Iterated through each word in the first array • Avoided duplicate checks by ensuring each word is processed only once • Counted occurrences of the current word in both arrays • If the word appears exactly once in both arrays, incremented the result • Returned the final count Performance: ✓ Runtime: 88 ms (Beats 7.45% submissions) ✓ Memory: 46.06 MB (Beats 93.07% submissions) Key Learning: ✓ Practiced handling duplicates and frequency counting ✓ Improved understanding of string comparison in arrays ✓ Learned importance of optimizing nested loop solutions Learning one problem every single day 🚀 #Java #LeetCode #DSA #Strings #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 94/100 – Consistency Journey Today’s focus: Strings in DSA + Java Multithreading Practiced string problems involving sliding window, two pointers, and pattern-based thinking. Realized how much efficiency improves when you move from brute force to optimized approaches. On the backend side, explored ExecutorService in Java — understanding how thread pools help manage multiple tasks efficiently instead of creating threads manually every time. Key takeaway: DSA builds problem-solving mindset, while backend concepts like multithreading show how things actually scale in real-world systems. Slowly connecting both worlds. Consistency > Motivation. #Day94 #100DaysOfCode #DSA #Java #BackendDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
Day 3/100 – LeetCode DSA Challenge Today I solved “Contains Duplicate” using Java. Problem: Given an integer array, determine if any value appears at least twice. Return true if any duplicate exists, otherwise false. Approach: I used a HashSet to track elements while iterating through the array. If an element is already present in the set, it means a duplicate is found. This allows detection in a single pass. Time Complexity: O(n) Space Complexity: O(n) What I Learned: * HashSet is useful for quick lookup and duplicate detection * Using extra space can significantly reduce time complexity * Strengthened my understanding of hashing in Java Continuing the journey with consistency. #100DaysOfCode #DSA #LeetCode #Java #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 47/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 448. Find All Numbers Disappeared in an Array Used an in-place marking technique by treating indices as a hash map and marking visited numbers as negative to identify missing elements. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) (excluding output list) Strengthening understanding of array manipulation and in-place hashing tricks. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #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