🚀 Day 14/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 3162. Find the Number of Good Pairs I Used a nested loop (brute-force) approach to check divisibility condition nums1[i] % (nums2[j] * k) == 0 for all possible pairs. ⏱️ Time Complexity: O(n × m) 📦 Space Complexity: O(1) Strengthening fundamentals by mastering basic logic and edge cases before jumping into optimizations. 💪 Consistency + clarity = long-term growth 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
Mastering Java with LeetCode Challenge 3162
More Relevant Posts
-
🚀 Day 24/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 2859. Sum of Values at Indices With K Set Bits Used bit manipulation to count the number of set bits in each index and summed the values whose index contains exactly k set bits. ⏱️ Time Complexity: O(n log n) 📦 Space Complexity: O(1) Strengthening understanding of bitwise operations and binary representation through consistent practice. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 20/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 350. Intersection of Two Arrays II Used sorting + two-pointer technique to efficiently find common elements appearing in both arrays while maintaining correct frequency. ⏱️ Time Complexity: O(n log n + m log m) 📦 Space Complexity: O(min(n, m)) (for storing the intersection) Strengthening understanding of array traversal and two-pointer pattern through consistent practice. 💪 Consistency keeps the progress moving 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 34/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 709. To Lower Case Used ASCII manipulation to convert uppercase letters to lowercase by adding 32, without using built-in functions. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) Strengthening understanding of character encoding and string manipulation basics. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 31/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 69. Sqrt(x) Used the Binary Search approach to find the integer square root without using built-in power functions. The search space is reduced by checking mid * mid against x. ⏱️ Time Complexity: O(log n) 📦 Space Complexity: O(1) Strengthening problem-solving skills with binary search patterns on answer space. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 13 of #LeetCode Challenge 🔢 Problem: 1758 – Minimum Changes To Make Alternating Binary String Today’s problem was about converting a binary string into an alternating pattern with minimum changes. 💡 Key Insight: An alternating string can only start with either ‘0’ or ‘1’. So instead of trying many possibilities, I compared both patterns and counted mismatches — then returned the minimum. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) ✨ This problem improved my thinking in: Pattern observation Optimization approach Writing clean and efficient Java code Consistency > Motivation 💪 #Day13 #Java #DSA #LeetCode #CodingJourney #FutureFullStackDeveloper
To view or add a comment, sign in
-
-
LeetCode Problem || Check if Binary String Has at Most One Segment of Ones(1784)🚀 we need to check: The string should have only one continuous block of '1's. After a '0' appears, '1' should never appear again. ✨ Insight: Instead of manually counting segments using loops, we can simply check if "01" exists in the string. 📌 Time Complexity: O(n) Practicing problems like these helps improve pattern recognition and problem-solving efficiency. #LeetCode #DSA #Java #CodingPractice #ProblemSolving
To view or add a comment, sign in
-
-
🚀Day 11 of #Leetcode75 LeetCode #392 – Is Subsequence | Two Pointer Approach Today I solved “Is Subsequence” (Easy) and revised an important concept — the Two Pointer Technique. 🔎 Problem Summary: Given two strings s and t, determine whether s is a subsequence of t. A subsequence maintains the relative order of characters but doesn’t need to be continuous. 💡 Key Insight: Instead of using extra space or complex logic, we can solve this efficiently using two pointers: ✔ One pointer for s ✔ One pointer for t ✔ Move forward and match characters in order ⏱ Time Complexity: O(n) 📦 Space Complexity: O(1) This problem reinforces how powerful simple logic can be when applied correctly. Consistency > Complexity 💪 Excited to keep improving step by step! #LeetCode #DSA #Java #CodingPractice #ProblemSolving #100DaysOfCode #TechJourney
To view or add a comment, sign in
-
-
🚀 Day 73 / 100 Days of LeetCode Question: Check if Binary String Has at Most One Segment of Ones Given a binary string s, determine whether it contains at most one continuous segment of '1's. Solved in Java by checking whether the pattern "01" exists in the string. If "01" appears, it means a new segment of 1s starts after a 0, which violates the condition. This provides a clean and efficient solution. Consistency > perfection. Day 74 loading 🔥 #100DaysOfCode #LeetCode #Java #DSA #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 18/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 1528. Shuffle String Used a direct indexing approach by placing each character at its correct position using the given indices array. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) A simple yet important problem to strengthen understanding of arrays and index mapping. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
Day: 72/365 📌 LeetCode POTD: Count Submatrices With Equal Frequency of X and Y Medium Key takeaways/Learnings from this problem: 1. The key idea is converting the problem into numbers (like +1 and -1) so equal frequency turns into a sum = 0 problem. 2. 2D prefix sums really help here—you can quickly get submatrix sums without recalculating every time. 3. It’s a nice extension of 1D subarray problems to 2D, so knowing those basics pays off big time. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
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