📅 Day 10 – Strings in Java 📚 Topic: String Manipulation (Hashing) Today I solved the problem of checking whether two strings are anagrams using an efficient frequency-count approach. This helped me understand how hashing can be used to compare character distributions instead of sorting. ✔ Key Learnings: • Applied hashing using a frequency array • Improved understanding of character frequency comparison • Learned how to optimize from sorting (O(n log n)) to linear time (O(n)) Building problem-solving skills step by step and focusing on writing efficient code 🚀 #DSA #Strings #Java #ProblemSolving #LearningJourney
Java String Anagrams with Hashing
More Relevant Posts
-
#Day86 of #100DaysOfCode Started learning String manipulation in Java. Covered: * Basic string operations * Using built-in methods like length() and charAt() Practiced problems like: * Reversing a string * Checking palindrome strings * Counting vowels Focused on understanding how to process and manipulate text data. #Java #Strings #100DaysOfCode
To view or add a comment, sign in
-
-
📅 Day 11 – Strings in Java 📚 Topic: String Manipulation (Hashing) Today I worked on finding the first unique character in a string using a frequency-based approach. This problem reinforced how hashing can help efficiently track and analyze character occurrences. ✔ Key Learnings: • Used frequency array for character counting • Applied two-pass traversal for efficient solution • Improved understanding of hashing in strings Consistently improving problem-solving skills with optimized approaches 🚀 #DSA #Strings #Java #ProblemSolving #LearningJourney
To view or add a comment, sign in
-
-
🚀 I thought I knew Java Arrays… until I actually revised them properly. Most beginners memorize syntax like: int[] arr = new int[5]; But interviews don’t test syntax. They test understanding. Here’s what actually matters: • Why array index starts from 0 • How memory is allocated internally • Why arrays are fixed size • Why O(1) access time makes arrays powerful • When to use Array vs ArrayList If your array basics are weak, Data Structures will feel difficult. Today I revised: ✔ Declaration & Initialization ✔ 2D and Jagged Arrays ✔ Traversal methods ✔ Arrays utility methods Strong fundamentals > Fancy topics. Are your array basics really strong? #Java #DSA #Programming #JavaDeveloper #CodingJourney
To view or add a comment, sign in
-
-
Day 66 of #100DaysOfLeetCode 💻✅ Solved #3427. Sum of Variable Length Subarrays problem in Java. Approach: • Iterated through each index of the array • Determined the starting index using i - nums[i] • Ensured the start index does not go below 0 • Calculated sum of elements from start to current index i • Added each subarray sum to the total Performance: ✓ Runtime: 1 ms (Beats 99.90% submissions) ✓ Memory: 45.22 MB (Beats 56.30% submissions) Key Learning: ✓ Practiced handling variable-length subarrays ✓ Improved understanding of index-based range calculations ✓ Strengthened nested loop logic for array problems Learning one problem every single day 🚀 #Java #LeetCode #DSA #Arrays #PrefixSum #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Day 89 of #100DaysOfLeetCode 💻✅ Solved #15. 3Sum problem in Java. Approach: • Sorted the array first • Fixed one element and used Two Pointers for the rest • Skipped duplicates to avoid repeated triplets • Adjusted pointers based on sum comparison Performance: ✓ Runtime: 30 ms (Beats 87.77% submissions) ✓ Memory: 59.02 MB (Beats 77.30% submissions) Key Learning: ✓ Mastered Two Pointer technique with sorting ✓ Learned handling duplicates efficiently ✓ Improved problem-solving for combination-based problems Learning one problem every single day 🚀 #Java #LeetCode #DSA #TwoPointers #Arrays #Sorting #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
Solved LeetCode 17 – Letter Combinations of a Phone Number using backtracking in Java. Approach: Mapped each digit (2–9) to its corresponding characters using a simple array for O(1) access. Then used backtracking to build combinations digit by digit. For every digit: Pick each possible character Append → explore next digit → backtrack Key idea: Treat it like a tree of choices, where each level represents a digit and branches represent possible letters. Key learnings: Backtracking = build → explore → undo StringBuilder helps avoid unnecessary string creation Problems like this are about systematic exploration of choices Time Complexity: O(4^n * n) Space Complexity: O(n) recursion stack + output Consistent DSA practice is strengthening pattern recognition day by day. #Java #DSA #Backtracking #LeetCode #CodingInterview #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 Day 23 of #75DaysOfCode Solved: Equal Row and Column Pairs 🔹 Problem: Given an n x n matrix, count the number of pairs (ri, cj) such that row ri and column cj are exactly the same. 🔹 Approach: • Stored all rows in a HashMap with their frequency • Converted each column into a comparable string format • Matched columns with stored rows to count equal pairs 🔹 Key Learning: Using StringBuilder instead of String concatenation significantly improves performance due to immutability of Strings in Java. 🔹 Time Complexity: O(n²) 🔹 Takeaway: Smart use of HashMap + efficient string handling can simplify and optimize matrix-based problems. #Day22 #75DaysOfCode #Java #DSA #LeetCode #CodingJourney #ProblemSolving
To view or add a comment, sign in
-
-
🚀 Day 51 – Mastering LinkedList in Java Today I explored one of the most important data structures in Java Collections – LinkedList. 🔍 Key Learnings: ✔ Understood how LinkedList works internally using Doubly Linked List (nodes) ✔ Learned the difference between ArrayList vs LinkedList (dynamic vs node-based storage) ✔ Explored constructors and how to copy data using Collection constructor ✔ Deep dive into Polymorphism & Loose Coupling in real-time usage 💡 Accessing Elements Techniques: 🔹 For Loop (get(index)) 🔹 Enhanced For Loop (for-each) 🔹 Iterator (forward traversal) 🔹 ListIterator (forward + backward traversal) ⚡ Realization: Understanding how data is accessed and traversed is just as important as storing it. Concepts like Iterator vs ListIterator are very crucial for interviews. 📈 Step by step, building strong foundations in Core Java & Collections Framework #Java #LinkedList #CollectionsFramework #CoreJava #Programming #LearningJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 52/100 Today’s problem was based on String Manipulation — reversing the first k characters of a string. 🧠 What I learned: - How to efficiently manipulate strings - Using "StringBuilder" for reversal in Java - Writing clean and optimized code 💡 Approach: Reversed the first k characters and appended the remaining string. ⚡ Key Insight: Even simple problems help strengthen fundamentals, which are crucial for solving complex problems later. 👨💻 Code (Java): class Solution { public String reversePrefix(String s, int k) { String first = new StringBuilder(s.substring(0, k)).reverse().toString(); String rest = s.substring(k); return first + rest; } } 📈 Consistency is the key — showing up every day matters more than perfection. #Day52 #CodingChallenge #Java #DSA #LearningJourney #Consistency #100DaysOfCode
To view or add a comment, sign in
-
-
📅 Day 15 – DSA with Java 📚 Topic: Linked List Started a new topic today and solved the Reverse Linked List problem. It was a great introduction to pointer manipulation and understanding how data structures work beyond arrays and strings. ✔ Key Learnings: • Understood linked list traversal and reversal • Applied pointer manipulation using iterative approach • Improved problem-solving with space optimization Excited to explore more in Linked Lists 🚀 #DSA #LinkedList #Java #ProblemSolving #LearningJourney
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