Skip to content

Latest commit

 

History

History

regex-validate-pin-code

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.

If the function is passed a valid PIN string, return true, else return false.

eg:

Solution.validatePin("1234") === true
Solution.validatePin("12345") === false
Solution.validatePin("a234") === false