Problem Brief
Valid String Check
OA
See Uber online assessment and hiring insights
Given a string, check if it is valid (return 1 :) or not (return 0 :). A valid string must:
1Example 1
Input
s = "771"
Output
1
Explanation
:)
2Example 2
Input
s = "777"
Output
1
Explanation
:)
3Example 3
Input
s = "123777"
Output
1
Explanation
:)
4Example 4
Input
s = "12345"
Output
0
Explanation
:)
5Example 5
Input
s = "71"
Output
0
Explanation
:)
6Example 6
Input
s = "171"
Output
0
Explanation
:)
7Example 7
Input
s = "70"
Output
0
Explanation
:)