----------LeetCode Progress Update Solved: Positions of Large Groups (830) * Problem Insight: Identify groups of consecutive identical characters and return intervals where the group size ≥ 3. * Approach: • Used two pointers (i, j) to scan continuous character groups • Expanded j while characters matched • Checked group length (j - i >= 3) • Stored valid intervals and moved to next group * Key Learning: Two-pointer technique is powerful for handling contiguous segments efficiently in strings. #LeetCode #DSA #Java #TwoPointers #ProblemSolving
Solved LeetCode 830: Positions of Large Groups
More Relevant Posts
-
🔥 Day 58 of #100DaysOfCode Solved – Check Balanced String 🔍 What I did: Traversed the string and calculated the sum of digits at even and odd indices separately, then compared both sums to determine if the string is balanced. 💡 Key Learning: Practiced string traversal and indexing Improved understanding of even vs odd index logic Learned how to convert char to integer (c - '0') 🎯 Takeaway: Even simple index-based problems can strengthen your fundamentals and attention to detail. #Day58 #LeetCode #Java #ProblemSolving #CodingJourney #100DaysOfCode #DSA
To view or add a comment, sign in
-
-
🚀 Day 52/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 3174. Clear Digits Used a stack-like approach with StringBuilder to remove the closest non-digit character whenever a digit is encountered. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) Strengthening understanding of string processing and stack-based logic simulation. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 65/100 Today’s problem was about cyclic string transformation (index shifting). 🔹 Problem: Encrypt a string by replacing each character with the k-th character ahead in a circular manner. 🔹 Key Learning: - Understood how to use modulo (%) for cyclic traversal - Learned that shifting indices is often easier than modifying characters - Optimized solution using "(i + k) % n" 🔹 Approach: - Loop through the string - For each index, pick the character at "(i + k) % n" - Build the result string 🔹 Time Complexity: O(n) 💡 Small concept, but powerful pattern for many problems involving circular arrays/strings. Consistency > Motivation 💯 #Day65 #100DaysOfCode #Java #DSA #CodingJourney #KeepLearning
To view or add a comment, sign in
-
-
🚀 Day 69/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 2103. Rings and Rods Used a 2D boolean array to track presence of colors (R, G, B) on each rod and counted rods containing all three. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(1) Strengthening understanding of mapping, indexing, and state tracking techniques. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
LeetCode — Problem 189 | Day 3 💡 Problem: Rotate Array Given an array, rotate it to the right by k steps. 🧠 My Approach: - Used reverse technique for in-place rotation - First reversed the entire array - Then reversed first k elements - Finally reversed remaining elements - Handled k using k = k % n This problem gave a good understanding of: ✔️ Array manipulation ✔️ In-place optimization (O(1) space) ✔️ Reverse logic #LeetCode #DSA #Java #CodingJourney
To view or add a comment, sign in
-
-
🚀 Day 10 of #LeetCode Challenge 🔍 Problem: Isomorphic Strings 💡 Approach: Used two arrays (mapping technique) to track character mapping between both strings. Checked if characters from s and t follow the same pattern Stored last seen positions using arrays If mappings don’t match → return false 🧠 Key Concept: Ensuring one-to-one mapping between characters while preserving order. 🔥 #Day10 #LeetCode #Java #DSA #Strings #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 18/100 — #100DaysOfLeetCode Showing up every day and trusting the process 💻🔥 ✅ Problem Solved: 🔹 LeetCode 242 — Valid Anagram 💡 Concepts Used: Character Frequency Counting HashMap / Array Counting Technique 🧠 Key Learning: Two strings are anagrams if they contain the same characters with the same frequency. Instead of sorting both strings, I learned how counting character frequencies allows verification in O(n) time with better efficiency. ⚡ Takeaway: Many string problems become simple once we track frequency instead of position. Step by step, patterns in string problems are becoming clearer 🚀 #100DaysOfLeetCode #LeetCode #DSA #Strings #HashMap #Java #ProblemSolving #CodingJourney #LearningInPublic #Consistency
To view or add a comment, sign in
-
-
🚀 Day 57/180 | #180DaysOfCode 📍 LeetCode | 💻 Java Solved: 242. Valid Anagram Used a HashMap frequency counting approach (Unicode-safe using code points) to compare character frequencies of both strings. ⏱️ Time Complexity: O(n) 📦 Space Complexity: O(n) Strengthening understanding of string frequency analysis and Unicode handling. 💪 Consistency continues 🚀 #DSA #LeetCode #Java #CodingJourney #Consistency
To view or add a comment, sign in
-
-
🚀 Day 27/100 Days of Code Challenge Today’s problem: Find Peak Element (Leetcode 162) 🔍 What I learned: How to find a peak element efficiently without scanning the entire array Using Binary Search to reduce time complexity from O(n) to O(log n) Understanding how the “slope” of elements helps decide the search direction 🧠 Key Idea: Instead of checking every element, compare the middle element with its neighbor: If nums[mid] < nums[mid + 1] → move right Else → move left ✅ Example: Input: [1, 2, 3, 1] Output: 2 (index of peak element 3) Consistency is key 🔑 — improving problem-solving skills one day at a time! 💪 #Day27 #100DaysOfCode #LeetCode #BinarySearch #DSA #Java #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