7 kyu
Regex validate PIN code
69,782 of 189,387JMurphyWeb
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 | 317533 |
Total Skips | 30756 |
Total Code Submissions | 980461 |
Total Times Completed | 189387 |
JavaScript Completions | 69782 |
Python Completions | 81626 |
C# Completions | 10776 |
TypeScript Completions | 3694 |
Java Completions | 19706 |
CoffeeScript Completions | 42 |
Crystal Completions | 52 |
Ruby Completions | 1766 |
Rust Completions | 1843 |
C Completions | 1802 |
Factor Completions | 21 |
Scala Completions | 121 |
Lua Completions | 44 |
Groovy Completions | 9 |
PHP Completions | 310 |
Total Stars | 2315 |
% of votes with a positive feedback rating | 88% of 13874 |
Total "Very Satisfied" Votes | 10879 |
Total "Somewhat Satisfied" Votes | 2613 |
Total "Not Satisfied" Votes | 382 |