Pursuant to the first problem in this series, this one involves checking for divisibility by 7.
Write a function to determine if a number is divisible by 7. This can be done by a variety of methods. Some are:
The restriction for multiplication has been lifted for this specific problem.
Previous problem: divisible by 6. Next problem: divisible by 8.
I didn't see that the check for the multiplication symbol was commented out for this test suite until I checked your solution...
Sorry about that. I added a statement that that function restriction is lifted in the problem description. Still, I'm impressed that you were able to solve it without using that function.
No worries. Multiplication without the * symbol is easy enough. There's a reason the final variable in my first solution is named "cheat" though; I had no idea how to accomplish the final check otherwise.
Well, I'll take that as a compliment, then, because your problems are clever and often stump me.
Number of 1s in the Binary Representation of a Number
308 Solvers
Get the elements of diagonal and antidiagonal for any m-by-n matrix
173 Solvers
Return a list sorted by number of consecutive occurrences
103 Solvers
139 Solvers
Implement a bubble sort technique and output the number of swaps required
78 Solvers