Welcome to the daily solving of our PROBLEM OF THE DAY with Yash Dwivedi. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Number theory but also build up problem-solving skills.
In this problem, we are given a string representation of a decimal number s, and check whether it is divisible by 8.
Example :
Input:
s = "16"
Output:
1
Explanation:
The given number is divisible by 8, so the driver code prints 1 as the output.
Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems-preview/check-if-a-number-is-divisible-by-83957/1
Solution IDE Link: https://ide.geeksforgeeks.org/online-cpp14-compiler/c664b5cd-782e-4ced-af52-6c2bb87bcb61