Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2047. Number of Valid Words in a Sentence
Count how many space-separated tokens in a sentence are "valid words" under the rules that they contain only lowercase letters, at most one hyphen (which if present must be surrounded by letters), no digits, and at most one punctuation mark (! , .) which, if present, must appear only at the end of the token. Split by spaces and validate each token against these constraints.
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.