Problem-solving is not limited to numbers and arrays — strings demand a different way of thinking. This week, I focused on string-based problems, where attention to detail, recursion, and pattern recognition play a major role. These problems helped me improve how I break down logic and handle edge cases. 🔗 GitHub Repository (Code & Logic): https://lnkd.in/gQHKDf7Z All solutions are implemented using Java, with logic as the main priority. 📌 String problems solved this week: Step by step, strengthening fundamentals and staying consistent 🚀 #ProblemSolving #Java #Strings #DSA #Recursion #LearningJourney #Consistency #SoftwareDevelopment
Improving String Problem-Solving with Java Recursion
More Relevant Posts
-
100 Days of Coding Challenge – Day 16 📌 Problem: Roman to Integer 💻 Language: Java 🧠 Concept Used: HashMap + Conditional Traversal 🔍 Platform: LeetCode Today’s challenge was converting a Roman numeral into its integer representation. Approach: ✔ Stored Roman symbols and values in a HashMap ✔ Traversed the string from left to right ✔ If the current value is smaller than the next → subtract ✔ Otherwise → add Time Complexity: O(n) Space Complexity: O(1) 🔗 Problem Link: https://lnkd.in/g2YTaPrG 🔗 Code: https://lnkd.in/g7e_Y7V7 #100DaysOfCode #Day16 #Java #DSA #LeetCode #Strings #ProblemSolving #CodingJourney
To view or add a comment, sign in
-
-
Day: 53/365 📌 LeetCode POTD: Concatenation of Consecutive Binary Numbers Medium Key takeaways/Learnings from this problem: 1. This problem nicely mixes math + bit manipulation, especially understanding how many bits each number contributes. 2. Instead of literally concatenating strings, shifting the current result left by the bit-length is way more efficient. 3. It reinforces the idea that log2 helps you find bit length quickly for each number. 4. Big takeaway: always think in terms of binary operations when the problem screams “binary” — strings are usually a trap here. #POTD #365DaysOfCode #DSA #Java #ProblemSolving #LearningInPublic #Consistency 🥷
To view or add a comment, sign in
-
-
🚀 DSA Consistency — Day 10 Continuing my consistency journey, today I solved the LeetCode problem “Sort Integers by The Number of 1 Bits.” 🔎 Key learning from today: The problem focused on sorting elements based on a custom criteria — primarily the count of set bits in each number, and secondarily their numeric value. I approached this by grouping numbers according to their set bit count using ordered data structures and then sorting within each group. 💡 This problem reinforced: ✅ Bit manipulation fundamentals ✅ Custom sorting logic ✅ Effective use of Java Collections (TreeMap + ArrayList) ✅ Translating problem constraints into clean implementation Maintaining daily problem-solving discipline is helping me sharpen both my problem-solving mindset and implementation clarity. 📌 You can check out my solution here: https://lnkd.in/d-ESnvjq #DSA #LeetCode #Consistency #ProblemSolving #Java #BitManipulation #CodingJourney
To view or add a comment, sign in
-
-
Day 11 of my #LeetCodeDailyChallenge Today’s problem: Valid Parentheses Topic: Stack | Strings Difficulty: Easy In this problem, I practiced using a stack data structure to validate whether brackets in a string are properly opened and closed. It strengthened my understanding of how Last-In-First-Out logic helps track matching pairs efficiently and detect invalid sequences early. Key learnings: Practical use of stack for pattern validation Importance of mapping pairs correctly Writing clean conditional logic for edge cases Daily consistency is helping me improve both problem-solving speed and coding clarity. #DSA #Java #CodingJourney #ProblemSolving #LearningInPublic
To view or add a comment, sign in
-
Day 13/30 – Binary Search Deep Dive 🚀 Problem: Find First and Last Position of Element in Sorted Array. Key Insight: One Binary Search is not enough. Solution: • Run Binary Search to find first occurrence • Run Binary Search again to find last occurrence • Maintain O(log n) time complexity Learning: Small modification in condition → big difference in result. #30DaysOfCode #Java #BinarySearch #DSA #InterviewPrep
To view or add a comment, sign in
-
-
🚀 #100DaysOfCode | Day 35 📌 LeetCode : Minimum Depth of Binary Tree Today I solved the Minimum Depth of Binary Tree problem using Java. The goal was to find the shortest path from the root node to the nearest leaf node. I applied a recursive approach while carefully handling edge cases where one subtree is null. Instead of directly taking the minimum of both sides, I ensured the solution correctly skips null paths to avoid incorrect depth calculations. 📌 Key takeaways: 🔹 Understood the difference between minimum and maximum depth logic 🔹 Learned the importance of handling null child nodes 🔹 Strengthened recursion and tree traversal concepts 🔹 Improved problem-solving accuracy in edge cases This problem helped me think more clearly about tree structures and reinforced the importance of precise base conditions in recursion. #Java #LeetCode #DSA #ProblemSolving #CodingJourney #100DaysOfCode
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
-
-
Day 30 of #100DaysOfLeetCode 💻✅ Solved #108. Convert Sorted Array to Binary Search Tree on LeetCode using Java. Approach: • Used Divide and Conquer strategy • Selected the middle element as the root to maintain balance • Recursively built the left subtree using left half of array • Recursively built the right subtree using right half of array • Ensured the tree remains height-balanced at every step Performance: ✓ Runtime: 0 ms (Beats 100.00% submissions) ✓ Memory: 45.18 MB (Beats 44.10% submissions) Key Learning: ✓ Understood how sorted arrays can directly map to balanced BST ✓ Strengthened recursion fundamentals in tree construction ✓ Improved understanding of height-balanced binary trees Learning one problem every single day 🚀 #Java #LeetCode #DSA #BinarySearchTree #Recursion #DivideAndConquer #ProblemSolving #CodingJourney #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 25 of Solving DSA Problems 🧠 Pattern Learned: Prefix Sum + HashMap Today I learned one of the most powerful patterns for solving subarray problems efficiently. 💡 Key Idea: If the difference between two prefix sums equals k, then the subarray between them has sum k. So while traversing the array: keep adding to prefix sum check if (currentSum − k) was seen before if yes → we found a valid subarray ⚡ This avoids checking all subarrays and reduces complexity from O(n²) → O(n). ⏱ Complexity: Time → O(n) Space → O(n) 🔥 Lesson: Prefix sum turns a range problem into a lookup problem using hashing — and that’s a game-changer. Consistency builds clarity 📈 #DSA #Java #ProblemSolving #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
16/100 🧠 “building focus, strengthening logical thinking, and staying consistent with problem solving.” Today I explored method overloading and cleaner code structure in Java by working on a simple greeting program. Focused on understanding how different method signatures can handle different inputs while keeping the logic organized and reusable. It was interesting to see how constants, formatting, and conditional checks make the code more structured and readable. Even small programs like this help improve clarity in designing methods and thinking about edge cases. Strengthening fundamentals and writing cleaner code, one step at a time. #Java #OOP #CleanCode #ProblemSolving #LogicalThinking #LearningInPublic #CodingJourney #ConsistencyChallenge
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