Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Playing with mobile numbers
Easy Accuracy: 22.22% Submissions: 9 Points: 2

Given a number in form of a string s. The task is to find whether the number is valid indian mobile number or not.
Rules for valid :-indian mobile number

1. The number should contain 10 or 11 or 12 digits.
2. If it contains 10 digits, then first  digit should be 7 or 8 or 9.
3. If it contains 11 digits, then first  digit should be 0 and second rule follwed.
4. If it contains 12 digits, then first two digits should be 91 and second rule followed

Example 1:

Input: s = "912345678999"
Output: 1

Example 2:

Input: s = "123456789"
Output: 0


You don't need to read or print anything. Your task is to complete the function is_valid() which takes s as input parameter and returns 1 if it is valid indian mobile number otherwise returns 0.

Expected Time Complexity: O(1)
Expected Space Complexity: O(1)

Constraints:
1 <= |s| <= 13