7 kyu
Regex validate PIN code
68,747 of 186,000JMurphyWeb
Description:
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
.
Examples (Input --> Output)
"1234" --> true
"12345" --> false
"a234" --> false
Regular Expressions
Fundamentals
Similar Kata:
Stats:
Created | Sep 15, 2015 |
Published | Sep 15, 2015 |
Warriors Trained | 312976 |
Total Skips | 30451 |
Total Code Submissions | 969170 |
Total Times Completed | 186000 |
JavaScript Completions | 68747 |
Python Completions | 79969 |
C# Completions | 10640 |
TypeScript Completions | 3596 |
Java Completions | 19394 |
CoffeeScript Completions | 42 |
Crystal Completions | 52 |
Ruby Completions | 1747 |
Rust Completions | 1802 |
C Completions | 1729 |
Factor Completions | 21 |
Scala Completions | 117 |
Lua Completions | 35 |
Groovy Completions | 8 |
PHP Completions | 243 |
Total Stars | 2295 |
% of votes with a positive feedback rating | 88% of 13788 |
Total "Very Satisfied" Votes | 10805 |
Total "Somewhat Satisfied" Votes | 2601 |
Total "Not Satisfied" Votes | 382 |