hackerrank.com

Practice>Python>Regex and Parsing>Validating Credit Card Numbers

건이두 2019. 4. 26. 12:47
728x90

hackerrank.com

Validating Credit Card Numbers

Problem Link : https://www.hackerrank.com/challenges/validating-credit-card-number/problem

Difficulty : Medium

 

Tip

  • It's a bit difficult to solve only using regular expression
  • Especially, 'NOT have  or more consecutive repeated digits'
  • More over, in test case 6, '-------' is given as a part of input, it should be filtered, also
  • Check condition 1~4 by using regular expression
  • Check condtion 5~6 by other code
 

Solution

728x90