题目描述
Given a number S, check if it is divisible by 8.
Example 1:
Input:
S=16
Output:
1
Explanation:
The given number is divisible by 8.
Example 2:
Input:
S=54141111648421214584416464555
Output:
-1
Explanation:
Given Number is not divisible by 8.
Your Task:
You don't need to read input or print anything.Your task is to complete the function DivisibleByEight() which takes a string S as input and returns 1 if the number is divisible by 8,else it returns -1.
Expected Time Complexity:O(1)
Expected Auxillary Space:O(1)
Constraints:
1 <= digits in S < 10^6
输入格式
见题面
输出格式
见题面
样例输入
S=16
样例输出
1