Ad
  • Default User Avatar

    It shouldn't matter if the input starts with a space. You're removing all of the spaces.

  • Custom User Avatar

    Other formats are not parsed as easy as the float format, and this is why I choose only this one. Also I'm sure if you are trying to store coordinates in your database you won't use any of the formats you mentioned.

  • Custom User Avatar

    Now seems like a good time :)

  • Custom User Avatar

    I found this snippet useful in debugging:

    print('<pre>' + height + '\n' + output + '</pre>');
    
  • Default User Avatar

    bookmarked -- definitely helped me wrap my head around the basics! thanks :)

  • Custom User Avatar

    Updated description and fixed the link. Thanks.

  • Custom User Avatar

    I added the image for the author. Thanks for this it should help make the requirements much more clear.

  • Custom User Avatar

    No, definitely not. If there are terms that people aren't clear on, it's good to know that they may need elaboration. :)

  • Custom User Avatar

    IMO that's part of the definition of "whitespace". http://en.wikipedia.org/wiki/Whitespace_character

  • Custom User Avatar

    Actually now that I think about it more, really in JavaScript the proper name for an "attribute" is always "property". I was thinking of attributes/properties like this:

    var a = {name: "name is an attribute"}
    
    Object.defineProperty(a, "name", {
      value: "name is a property"
    });
    

    but a.hasOwnProperty("name") would return true for each, so therefor they are both called properties.

  • Custom User Avatar

    I've corrected the JS/CS version to just indicate that the incProgress(rank) is a method. I left out referring to rank and progress as attributes or properties as they could technically be implemented as either. The reason why I used "class/object" in the case of JS is that the idea of a "class" in JS is really more of a guideline than an actual thing. Really its just a function, which is just another type of object, which gets treated like a class.

    In terms of Ruby, I agree with Josh. Attributes in Ruby are really just conceptual since they are nothing more than a macro/meta function that creates a method for you.

  • Custom User Avatar

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

  • Custom User Avatar

    There are LOTS of resources that explain how the algorithm works. The two resources I provided in the description should be enough to get you going. The algorithm isn't an easy one, so not everyone will be capable of coding it up. There are many challenges with algorithms that people already know how to solve. I love not knowing how the algorithm works. It makes it an even greater challenge :)

  • Custom User Avatar

    or Test.assertEquals( ...

  • Custom User Avatar
  • Loading more items...