problem #15 🙂 , 3 sum problem from #leetcode, unlike 2 sum problem, here we have to use 3 pointers to reach the target, this was little bit complicated than the 2 sum problem, of course we must avoid the duplicate numbers. TIME COMPLEXITY - o(n^2) #problemsolving #datastructuesandalgorithms #arrays #hardproblem #computerscience #3sumproblem #java #geeksforgeeks #leetcode #softwaredevelopment
3 Sum Problem Solution - Java
More Relevant Posts
-
🚀 Day 4 / 100: LeetCode Challenge Today’s problem: Longest Common Prefix ✅ Learned how sorting an array can simplify finding common prefixes. ✅ Compared the first and last strings after sorting to efficiently determine the prefix. ✅ Key takeaway: sometimes a small trick like sorting can reduce complexity and simplify logic. #100DaysOfCode #Java #LeetCode #CodingChallenge #Day4
To view or add a comment, sign in
-
-
Day 49-What I Learned In a Day (JAVA) Today, I focused on understanding the execution flow of static elements in Java. 🔹 Learned about: • Static variables and how they are shared across objects • Static methods and how they can be accessed without object creation • Static initializer (single-line) • Static initializer (multi-line) This helped me clearly understand how Java handles memory and execution at the class level before objects are created. Building strong fundamentals step by step! #Java #Programming #LearningJourney #OOP #TechSkills
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
-
-
💻 Java Practice Update | Largest Number in Array 📌 Problem: Find the largest number in an array 🧠 Approach: Assume first element as max Traverse array Compare each element Update max if larger value found ⚙️ Key Learning: Strengthens logic building and is useful in automation testing scenarios like validating UI tables and API responses. #Java #Arrays #CodingPractice #SDET #AutomationTesting interviewchat codeonedigest cod
To view or add a comment, sign in
-
-
#Day72 Of Problem Solving Solved today’s LeetCode Daily Challenge ✅. Problem: Check if Binary String Has at Most One Segment of Ones Sometimes, the simplest logic gives the best results. Instead of overthinking, I went with a clean approach—just checking if "01" exists in the string. If it does, that means more than one segment of 1’s… and that’s it! ✔️ All test cases passed ⚡ Runtime: 0 ms 📊 Beat 100% in performance This problem was a good reminder that not every solution needs complexity—clarity matters more. Consistency > Complexity 🚀 On to the next challenge! #LeetCode #DailyChallenge #Java #ProblemSolving #CodingJourney #100DaysOfCode #LinkedIn
To view or add a comment, sign in
-
-
Day 5 - Java Set Interface internal working !! 👉 Set is a collection that cannot contain duplicate values and un-ordered collection and internally using HashMap. 👉 Set has three implementations HashSet, TreeSet and LinkedHashSet. 👉 add(E element) When we add a value, internally adds a value in 'map' by calling put(E, o); E - Key & o - dummy Object #java #Backend #coding #learning #springboot #developer
To view or add a comment, sign in
-
-
🚀 Day 4/30 — LeetCode Challenge Solved the "Palindrome Number" problem on LeetCode using Java. The logic is simple, but the key is choosing the right approach — reversing only half of the number instead of the entire value to avoid unnecessary operations. ✅ Key takeaway: Even simple problems have smarter solutions if you focus on efficiency. Continuing to build consistency and improve problem-solving skills. #LeetCode #Java #Algorithms #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
🚀 Day 8/30 — LeetCode Challenge Solved "Swap Nodes in Pairs" on LeetCode using Java. This problem focuses on "rearranging node connections", not just swapping values — making pointer handling critical. Used a dummy node approach to simplify edge cases and ensure smooth pair-wise swapping. ✅ Key takeaway: Linked list problems are less about logic and more about **precise pointer management** — one wrong link can break the entire structure. #LeetCode #Java #LinkedList #DataStructures #ProblemSolving #Consistency
To view or add a comment, sign in
-
-
💻 Java Practice Update | Largest Number in Array 📌 Problem: Find the largest number in an array 🧠 Approach: Assume first element as max Traverse array Compare each element Update max if larger value found ⚙️ Key Learning: Strengthens logic building and is useful in automation testing scenarios like validating UI tables and API responses. #Java #Arrays #CodingPractice #SDET #AutomationTesting
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