Skip to content

Latest commit

 

History

History

validating-the-phone-number

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Validating phone numbers

https://www.hackerrank.com/challenges/validating-the-phone-number

Problem

Let's dive into the interesting topic of regular expressions! You are given some input, and you are required to check whether they are valid mobile numbers.

A valid mobile number is a ten digit number starting with a 7, 8 or 9.

Input format

The first line contains an integer N, the number of inputs. N lines follow, each containing some string.

Output format

For every string listed, print "YES" if it is a valid mobile number and "NO" if it is not on separate lines. Do not print the quotes.

Sample Input 0

2
9587456281
1252478965

Sample Output 0

YES
NO

My Solution