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
Solved LeetCode 3866 First Unique Even Element in Java
More Relevant Posts
-
Day 78 of #100DaysOfLeetCode 💻✅ Solved #299. Bulls and Cows problem in Java. Approach: • Used a frequency array to track digits • Counted bulls when characters matched directly • Used count array to efficiently track cows • Updated counts to handle unmatched digits Performance: ✓ Runtime: 3 ms (Beats 95.59% submissions) 🚀 ✓ Memory: 43.64 MB (Beats 52.40% submissions) Key Learning: ✓ Learned efficient use of frequency arrays ✓ Improved handling of strings with counting logic ✓ Strengthened understanding of bulls vs cows logic Learning one problem every single day 🚀 #Java #LeetCode #DSA #Strings #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 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 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 58/100 Today’s problem: Reverse Integer (LeetCode) 💡 What I learned: - How to reverse digits using modulo (%) and division (/) - Handling negative numbers automatically - Most important: dealing with 32-bit integer overflow without using long - Learned to check overflow before updating the result ⚡ Key Concept: Before doing "rev = rev * 10 + digit", always check: 👉 If value exceeds "Integer.MAX_VALUE" or "Integer.MIN_VALUE", return 0 🧠 Takeaway: Small problems can hide tricky edge cases. Overflow handling is the real challenge here! 💻 Language used: Java #Day58 #100DaysOfCode #Java #DSA #CodingJourney #LeetCode
To view or add a comment, sign in
-
-
🚀 𝐃𝐚𝐲 93/100 ✅ 𝐏𝐫𝐨𝐛𝐥𝐞𝐦: 𝐋𝐨𝐧𝐠𝐞𝐬𝐭 𝐂𝐨𝐧𝐭𝐢𝐧𝐮𝐨𝐮𝐬 𝐈𝐧𝐜𝐫𝐞𝐚𝐬𝐢𝐧𝐠 𝐒𝐮𝐛𝐬𝐞𝐪𝐮𝐞𝐧𝐜𝐞 Today’s problem focused on finding the length of the longest continuous increasing subarray. Unlike LIS, this must be strictly increasing AND contiguous. 💡 𝐊𝐞𝐲 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠𝐬: Use a simple linear scan Maintain two variables: curr and maxLen Reset streak when order breaks Time Complexity: O(n), Space: O(1) 𝐀𝐩𝐩𝐫𝐨𝐚𝐜𝐡: Traverse the array and compare each element with the previous one: If increasing → extend streak Else → reset streak Keep updating maximum length #Day93 #100DaysOfCode #LeetCode #Java #DSA #CodingJourney #ProblemSolving #KeepLearning
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
-
-
Day 68 of #100DaysOfLeetCode 💻✅ Solved #977. Squares of a Sorted Array problem in Java. Approach: • Traversed the array and squared each element • Used Arrays.sort() to sort the squared values • Returned the sorted array as the result Performance: ✓ Runtime: 10 ms (Beats 37.38% submissions) ✓ Memory: 47.98 MB (Beats 18.78% submissions) Key Learning: ✓ Practiced array transformation and sorting ✓ Learned how squaring affects order in sorted arrays ✓ Understood the importance of optimizing from O(n log n) to O(n) using two pointers Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #Sorting #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
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
To view or add a comment, sign in
-
-
Day 82 of #100DaysOfLeetCode 💻✅ Solved #11. Container With Most Water problem in Java. Approach: • Used Two Pointer technique • Calculated area using min height and width • Moved pointer with smaller height inward • Tracked maximum area throughout Performance: ✓ Runtime: 5 ms (Beats 83.17% submissions) ✓ Memory: 77.35 MB (Beats 53.65% submissions) Key Learning: ✓ Mastered Two Pointer optimization technique ✓ Learned efficient area calculation strategy ✓ Improved decision-making for pointer movement Learning one problem every single day 🚀 #Java #LeetCode #DSA #TwoPointers #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
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