Pursuant to the first problem in this series, this one involves checking for divisibility by 8.
Write a function to determine if a number is divisible by 8. This can be done by the following method:
Previous problem: divisible by 7. Next problem: divisible by 9.
Return the largest number that is adjacent to a zero
3108 Solvers
Convert a vector into a number
442 Solvers
342 Solvers
369 Solvers
Spot the First Occurrence of 5
304 Solvers
Solution 1281160
I don't why this does not pass, case 10 fails, even though this number is not divisible by 8 despite the case saying it does. Furthermore, I pass case 16 which has case 10 referenced but fail case 15 with the same case 10.
Any suggestions please!
Look *very* carefully at your definition of eightTable, and look at the last three digits of case 10.
Thank James, obvious now that you said it :)