🚀 Day 17/30 – LeetCode Java Challenge Back to a cleaner problem today — focused on tracking indices and minimizing distance. 📊 Result: ✔️ Accepted (899/899 test cases) ⚡ Runtime: 4 ms 💾 Memory: Could be improved 💡 What I learned: HashMaps are useful, but not always the most optimal choice Storing unnecessary data increases memory usage There’s often a simpler approach if you think deeper Let’s be honest: This solution works, but it’s not the most efficient in terms of memory. There’s a better way without storing full lists. Day 17 done. More focus on optimizing space, not just time. Bavani k Deepika Kannan Divya Suresh Hari priya B Devipriya R Archana J E Bhavya B Harini B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
Harilakshmi S’ Post
More Relevant Posts
-
🚀 **Day 4/30 – LeetCode Java Challenge** Today’s problem pushed me to think beyond basic comparisons and focus on **pattern-based validation**. Worked on a string problem where the key insight was separating characters based on **even and odd indices**, then comparing frequency distributions instead of direct string matching. 📊 **Result:** ✔️ Accepted (752/752 test cases) ⚡ Runtime: 5 ms (Beats 93.81%) 💾 Memory: Efficient (Beats 86.60%) 💡 **What actually mattered today:** * Brute force thinking won’t scale — pattern recognition does * Breaking a problem into smaller logical groups simplifies everything * Frequency arrays can outperform more complex data structures when used correctly Let’s be real: This wasn’t a hard problem, but the approach matters. If you miss the pattern, you overcomplicate it. If you see it early, the solution becomes clean and efficient. Day 4 done. Still building consistency, still sharpening fundamentals. Archana J E Bavani k Deepika Kannan Divya Suresh Hari priya B Devipriya R Harini B Bhavya B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
To view or add a comment, sign in
-
-
Day 65 - DSA Practice Solved LeetCode 237 – Delete Node in a Linked List. The catch is you don’t get the head or the previous node, so the usual deletion approach doesn’t work. Instead, copy the value from the next node and link to the node after it. This effectively removes the given node. Simple problem, but a good reminder to think differently when constraints block the obvious approach. #DSA #LeetCode #Java
To view or add a comment, sign in
-
-
Day 36/100 – Working with ArrayList in Java 📚 Today I practiced using ArrayList in Java, a dynamic array that allows flexible storage and manipulation of data. Unlike normal arrays, ArrayList can grow and shrink dynamically, making it very useful in real-world applications. Key learnings: • Adding elements using add() • Storing multiple values dynamically • Finding size using size() • Easier and more flexible than traditional arrays Understanding collections like ArrayList is important for handling data efficiently in Java. Building strong fundamentals step by step. 🚀 #100DaysOfCode #Java #ArrayList #DataStructures #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day 8/30 – Real-World Java Development Today I explored a small but important idea — not exposing everything directly. In the beginning, it feels easy to make variables public and access them anywhere. But in real applications, that can lead to unexpected changes and bugs. Started understanding why we use private variables and control access using methods. It’s less about restriction and more about keeping data safe and predictable. It made me realize — good code is not just about what we allow, but also about what we don’t allow. Still connecting these concepts with real-world usage #30DaysChallenge #Java #OOP #BackendDevelopment #LearningJourney
To view or add a comment, sign in
-
-
🚀 **Day 5/30 – LeetCode Java Challenge** Today’s problem was a step up — not in complexity, but in **how carefully the logic had to be applied**. Worked on constructing a valid string based on given conditions. The tricky part wasn’t writing code — it was **handling overlaps and conflicts correctly** without breaking earlier decisions. 📊 **Result:** ✔️ Accepted (739/739 test cases) ⚡ Runtime: 11 ms (Beats 77.08%) 💾 Memory: Moderate efficiency 💡 **What actually mattered today:** * Greedy thinking can fail if you don’t track constraints properly * Managing “state” (like locked positions) is critical in construction problems * Edge cases are where most solutions break — not the main logic Let’s be honest: This isn’t an optimal solution yet. There’s still room to improve both performance and clarity. But the bigger win is understanding **why conflicts happen and how to control them**. Day 5 done. Less guesswork, more control over logic. Archana J E Bavani k Hari priya B Deepika Kannan Divya Suresh Devipriya R Bhavya B Harini B Kezia H Vaishnavi Janaki #LeetCode #Java #DSA #ProblemSolving #Consistency #30DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 10/30 – Real-World Java Development Today I came across the concept of polymorphism. In simple terms, it means the same thing behaving differently based on the situation. In real-world applications, this happens more often than we notice. The same action can give different results depending on the context. For example, a single operation like “process” can behave differently for different types of data or scenarios. What I found interesting is — this helps in writing flexible code instead of repeating the same logic again and again. Still trying to connect these concepts with real use cases 👍 #30DaysChallenge #Java #OOP #BackendDevelopment #LearningJourney
To view or add a comment, sign in
-
📖 New Post: Java Memory Model Demystified: Stack vs. Heap Where do your variables live? We explain the Stack, the Heap, and the Garbage Collector in simple terms. #java #jvm #memorymanagement
To view or add a comment, sign in
-
Your Java Thread Model is Broken (Here's the Fix) Watch Full Video : https://lnkd.in/e_Usi8qA Website Link : https://systemdrd.com/ Full Course Link : https://lnkd.in/eM5jJyaQ OS threads cost 1MB each and cap you at ~2,000 connections. Java's virtual threads via Project Loom handle 1,000,000+ — with simpler code. Stop writing reactive chains. #JavaDeveloper #ProjectLoom #VirtualThreads #BackendEngineering #JavaTips #CodingShorts #SoftwareEngineering #Java2026
To view or add a comment, sign in
-
🚀 Beats 100% of all Java solutions on LeetCode! Just solved LeetCode #290 — Word Pattern in Java with 0ms runtime, outperforming every submission. Here's how I approached it 👇 🧩 Problem: Given a pattern (like "abba") and a string of words, check if the words follow the exact same pattern — a full bijection. e.g. pattern = "abba", s = "dog cat cat dog" → true ✅ 💡 My approach: Used a single HashMap<Character, String> to map each pattern character to its corresponding word. The key insight: also check containsValue() to prevent two different characters from mapping to the same word — ensuring true one-to-one bijection. 📊 Results: Runtime: 0 ms — Beats 100.00% 🌿 Memory: 42.65 MB — Beats 80.14% 🔑 Key takeaway: Always verify bijection in both directions — a one-way map is not enough for pattern matching problems. One extra containsValue() check is all it takes! All 44 test cases passed ✅ — Clean, simple, and blazing fast. #LeetCode #Java #DSA #CodingChallenge #ProblemSolving #100Percent #Programming #SoftwareEngineering #CompetitiveProgramming #HashMap
To view or add a comment, sign in
-
-
📒 Day 28 of Java madness, reference copy and garbage collection kept things interesting. Today I explored how Java handles reference copy, abandoned objects, and garbage collection. ➥ When one reference variable is assigned to another, Java copies the reference, not the actual object. That means both variables point to the same object in memory. ➥ If an object no longer has any active references, it becomes eligible for garbage collection. This automatic memory management is one of the reasons Java is so powerful and efficient. ⚡ A small concept, but an important one in understanding how Java manages memory behind the scenes. #Java #Day28 #GarbageCollection #ReferenceCopy #OOP #JavaProgramming #CodingJourney
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