"I'm not back." - Bill Harding, Twister
Originally posted by Campbell Ritchie:
Please don't simply give answers like that. The idea is for people to learn, and giving an answer doesn't teach anyboyd anything.
No, it doesn't.Originally posted by Jim Yingst:
Hm, it might be helpful to consider the full range of numbers that could be passed into that method. Does it give correct results for all possible int values?
Yes, it is much better.Originally posted by Gavin Tranter:
I just did a quick serach and there is a much much faster way.
If (n <= 0)Originally posted by Vishal Pandya:
Hello Jim,
Where does it fail?
Originally posted by Campbell Ritchie:
Yes, it is much better.
And Vishal, the idea of the Ranch is for people to work out their solutions with our help. There are cases where the poster reuires a straight answer, but this is probably not (yet) one of them.
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
Originally posted by Govind SrinivasaRaghavan:
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
--
Rodrigo Lopes
Originally posted by Campbell Ritchie:
HHD: show us what you've got, never mind how well or badly it works.
"I'm not back." - Bill Harding, Twister
Consider Paul's rocket mass heater. |