digits is a string, not a Fixnum
Do you need to be good at physics to solve this?
If size returns the number of bytes in a Fixnum, rather than the number of places, how does this solution work?
Yeah, that is a good point. Really there is no bulletproof way to prevent fencepost errors when working collaboratively -- better to get in the habit of checking for them often.
I really enjoyed this one. Good practice for Ruby-style recursion.
Not really. If my ranges are always inclusive, I know what side of the fence to be checking on.
You may not be testing for all applicable scenarios. In other words, just because it passed your tests doesn't mean it passed all the tests.
"Or" is precisely what you are missing. :)
Right, you are counting 15 twice, but we are only counting numbers that are multiples of 3 OR multiples of 5.
I personally always prefer inclusive to exclusive. My brain thinks it's nicer.
This comment is hidden because it contains spoiler information about the solution
Loading collection data...
digits is a string, not a Fixnum
Do you need to be good at physics to solve this?
If size returns the number of bytes in a Fixnum, rather than the number of places, how does this solution work?
Yeah, that is a good point. Really there is no bulletproof way to prevent fencepost errors when working collaboratively -- better to get in the habit of checking for them often.
I really enjoyed this one. Good practice for Ruby-style recursion.
Not really. If my ranges are always inclusive, I know what side of the fence to be checking on.
You may not be testing for all applicable scenarios. In other words, just because it passed your tests doesn't mean it passed all the tests.
"Or" is precisely what you are missing. :)
Right, you are counting 15 twice, but we are only counting numbers that are multiples of 3 OR multiples of 5.
I personally always prefer inclusive to exclusive. My brain thinks it's nicer.
This comment is hidden because it contains spoiler information about the solution