Java DSA Day 21: Largest 3-Digit Repeating Number in a String

🚀 Day 21 / 180 – DSA with Java 🚀 📘 Topic Covered: Strings & Pattern Detection 🧩 Problem Solved: Largest 3-Digit Repeating Number in a String Problem: Given a numeric string, find the largest substring of length 3 where all three digits are the same. If no such substring exists, return an empty string. Approach: Traversed the string and checked every group of three consecutive characters. Whenever three identical digits were found, compared them lexicographically to track the largest valid substring. Key Learning: ✔️ Detecting fixed-length patterns in strings ✔️ Using lexicographical comparison effectively ✔️ Careful boundary handling during traversal If you’re also preparing for DSA, let’s connect and learn together 🤝 #DSA #Java #180DaysOfCode #LearningInPublic #Strings #ProblemSolving #Consistency 

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories