221. Check the Magic Password
Easy · String
A magic password is valid if it: has at least 6 characters AND contains at least one number AND starts with a capital letter. Return true if valid, false otherwise.
Examples
Example 1 Input: "Luna123" Output: true Explanation: Length ≥ 6, has digit, starts with capital
Example 2 Input: "abc" Output: false Explanation: Too short
Constraints
- 1 ≤ password.length ≤ 50