Available question text
Remove non-digit characters from the input string and then split the digits into groups of three from left to right, adjusting the final groups so there are no single-digit blocks (if 4 digits remain split into two 2's; if 3 or 2 remain keep them as one block). Join the groups with dashes and return the result.
Related questions
Continue with questions that share topics or the same question type.
- Letter Combinations of a Phone Number
Coding · Backtracking · Hash Table · String
- Phone Number Prefix
Coding
- 1. Count number of islands in matrix (Leetcode challenge)
Coding
- A Number After a Double Reversal
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1694. Reformat Phone Number
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source