🚀 Day 3/30 — LeetCode Challenge Solved Median of Two Sorted Arrays on using Java. This wasn’t about merging arrays — the real challenge was applying binary search on partitions to achieve optimal time complexity. ✅ Key takeaway: Efficiency comes from thinking differently, not doing more work. Using partition-based binary search reduces complexity to O(log(min(n, m))). This problem pushed me to understand the logic deeply rather than just implementing it. #LeetCode #Java #Algorithms #BinarySearch #ProblemSolving #Consistency Archana J E Divya Suresh Harini B harilakshmi s Bavani k Bhavya B Devipriya R
Solved Median of Two Sorted Arrays with Java Binary Search
More Relevant Posts
-
🚀 Day 2/30 — LeetCode Challenge Solved the Reverse Integer problem on using Java. At first glance, reversing digits looks straightforward. But the real challenge is handling integer overflow within 32-bit limits — that’s where most implementations fail. ✅ Key takeaway: Correctness isn’t just about logic — it’s about respecting constraints and edge cases. Continuing to focus on writing solutions that are not just working, but reliable. #LeetCode #Java #ProblemSolving #DataStructures #Algorithms #Consistency
To view or add a comment, sign in
-
-
🚀 Day 6/30 — LeetCode Challenge Solved "Divide Two Integers" on LeetCode using Java. This problem restricts the use of division, multiplication, and modulus — forcing an alternative approach using "bit manipulation and subtraction logic". Handled tricky edge cases like overflow (Integer.MIN_VALUE / -1) to ensure correctness. ✅ Key takeaway: Constraints push you to think beyond standard solutions and understand how operations work at a deeper level. #LeetCode #Java #Algorithms #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 7/30 — LeetCode Challenge Solved "Roman to Integer" on LeetCode using Java. The key challenge was handling "subtractive notation"— cases like IV (4) and IX (9), where a smaller value appears before a larger one. Used a HashMap for value mapping and adjusted the result based on the relationship between adjacent characters. ✅ Key takeaway: Understanding patterns in rules is more important than just implementing logic. #LeetCode #Java #Algorithms #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 31 of #100DaysOfCode Solved Find Target Indices After Sorting Array 🔍 Today’s problem looked like a sorting question, but the real trick was avoiding sorting altogether 😏 💡 Key Insight: Count elements less than target → starting index Count elements equal to target → number of indices ⚡ No sorting needed → O(n) time, O(1) space 🔍 Learned: Optimize before you implement brute force Counting can replace sorting in many cases Cleaner logic = faster code 💻 Implemented in Java #DSAwithEdSlash #LeetCode #Java #ProblemSolving #100DaysOfCode @edslash
To view or add a comment, sign in
-
-
Day 76 of #100DaysOfLeetCode 💻✅ Solved #33. Search in Rotated Sorted Array problem in Java. Approach: • Applied Binary Search on rotated array • Checked which half is sorted at each step • Reduced search space based on target position Performance: ✓ Runtime: 0 ms (Beats 100.00% submissions) 🚀 ✓ Memory: 43.80 MB (Beats 70.96% submissions) Key Learning: ✓ Mastered searching in rotated sorted arrays ✓ Improved Binary Search decision-making ✓ Learned efficient handling of edge cases Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearch #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 48 of My #LeetCode Journey Today’s problem: 2615. Sum of Distances 💡 Key Idea: Instead of calculating distances between equal elements using brute force (O(n²)), I used: HashMap to group indices of same values Prefix Sum to efficiently compute distances This reduced the complexity to O(n) 🔥 🧠 What I Learned: How prefix sums can optimize distance calculations Efficient handling of repeated elements Writing clean and optimized code using Java ⚡ Approach: Store indices of each number Use prefix sums to calculate left & right distances Combine both to get final answer 📈 Time Complexity: O(n) 📦 Space Complexity: O(n) Consistency is key. Small progress every day leads to big results 💪 #Day48 #Java #FullStackDeveloper #CodingJourney #100DaysOfCode #DSA #LeetCode
To view or add a comment, sign in
-
💻 Interesting Java problem: Find the closest target in a circular array Given a words[] array, a target, and a startIndex, the task is to find the shortest circular distance to the target. Leetcode Problem :https://lnkd.in/g3RbdChE Core idea: For every matching target: find direct distance → Math.abs(i - startIndex) find circular distance → n - dist take the minimum. This is a neat example of how circular arrays require us to think beyond normal linear traversal. Small twist, smart logic. 🚀 #Java #Algorithms #DSA #CodingInterview #ProblemSolving #LeetCode
To view or add a comment, sign in
-
-
🚀 Day 15 of #DSAwithEdSlash Solved: Bulb Switcher 💡 Today’s problem looked simple at first but had a really interesting mathematical insight behind it. Instead of simulating all the toggles, the key realization is that only perfect squares remain ON after all rounds. 💡 Key Takeaways: Importance of pattern recognition 🔍 Optimization using mathematical logic instead of brute force Counting perfect squares ≤ n gives the answer 📊 Result: ⚡ Optimized Time Complexity: O(√n) 💻 Efficient Java implementation Consistency is building confidence day by day 💪 #Day15 #DSA #LeetCode #Java #ProblemSolving #CodingJourney #Consistency #PlacementPrep
To view or add a comment, sign in
-
-
Day 77 of #100DaysOfLeetCode 💻✅ Solved #153. Find Minimum in Rotated Sorted Array problem in Java. Approach: • Used Binary Search to find minimum element • Compared mid with right to decide direction • Reduced search space until pointers converged Performance: ✓ Runtime: 0 ms (Beats 100.00% submissions) 🚀 ✓ Memory: 43.62 MB (Beats 78.18% submissions) Key Learning: ✓ Strengthened Binary Search on rotated arrays ✓ Learned how to identify unsorted portion efficiently ✓ Improved optimization over linear search Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearch #Arrays #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
#repost Day1 - 𝐒𝐦𝐚𝐥𝐥 𝐂𝐨𝐧𝐜𝐞𝐩𝐭, 𝐁𝐢𝐠 𝐈𝐦𝐩𝐚𝐜𝐭 – 𝐉𝐚𝐯𝐚 𝐈𝐧𝐝𝐞𝐱𝐢𝐧𝐠 💡 In Java, array index starts from 0 because it represents the distance (offset) from the starting point in memory. 👉 Index 0 → First element (0 steps from start) 👉 Index 1 → Second element (1 step away) This makes calculations simple and fast: 𝑨𝒅𝒅𝒓𝒆𝒔𝒔 = 𝑩𝒂𝒔𝒆 + (𝑰𝒏𝒅𝒆𝒙 × 𝑺𝒊𝒛𝒆) 💡 Starting from 0 𝐚𝐯𝐨𝐢𝐝𝐬 𝐞𝐱𝐭𝐫𝐚 𝐜𝐚𝐥𝐜𝐮𝐥𝐚𝐭𝐢𝐨𝐧𝐬 𝐚𝐧𝐝 𝐢𝐦𝐩𝐫𝐨𝐯𝐞𝐬 𝐩𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞. That’s why most languages follow 0-based indexing. #java #coding #developer #learning #springboot
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