Ad
  • Default User Avatar

    Oh duh. Pardon my momentary lack of reading comprehension, I have been fighting the flu.

  • Custom User Avatar

    function: mean(town, strng) should return the average of rainfall for the city town and the strng data or data1 (In R this function is called avg).

    There can't be an average of rainfall (not temperature) of -1.

  • Default User Avatar

    Am I the only one who thinks returning -1 for non-existant town is a bad idea? Considering it's possible to have a mean temperature of -1? It may be a very unlikely scenario, but possible for certain cities in artic regions.

  • Custom User Avatar

    You're right of course. I was thinking wrong in exactly the opposite direction.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Only thing I don't really like about this solution is the double call of sqrt.

  • Default User Avatar

    I didn't fully look at the example in the description. Had I done so, I would have seen to exclude leading zeros instead of racking my brain why it kept getting wrong answers. On another note, java's Integer class makes this entirely way too easy.

  • Default User Avatar

    How is this even possible without knowing which bottles were given to each rat? I have never been so utterly lost by a puzzle in my life.

  • Default User Avatar

    I have never touched Ruby before. Still, only took about 30 seconds to write an solution. And then 30 minutes figuring out how to raise an exception without getting an error. In the end, I gave up and forfeited because everything I tried gave an error. Turns out, I wrote the exception correctly all along, I just checked the integer against 0xFFFFFF instead of 0xFFFFFFFF. FML.

  • Default User Avatar

    Well, I failed. By failed I mean had to look up a few tips. I had heard of this necessary class we needed to use, but I had never actually used it before. Had no idea I could stuff like that to another class. Frustrating due to the lack of initial direction but I did learn something out of it, even if I had to seek out a little help to get started.

  • Default User Avatar

    Guilty of that myself, simple fix though.

  • Default User Avatar

    Your code can never return index 0.

  • Default User Avatar

    pageCount() is incorrect. Imagine an item count of 50 with 10 items per page. You'd end up with an extra empty page.

  • Default User Avatar

    Most of these, including mine, would fail if the sentence contained more than a single space in a row.