Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1694. Reformat Phone Number
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.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.