Ad
  • Custom User Avatar

    What is '.toUpperCase() doing here? ( I know what it does but why are we using it here?)

  • Custom User Avatar

    can somebody explain me, what exactly happening or we doing in the sort after || or after the OR part?

  • Custom User Avatar

    Well here Array is an object and Object.assign does what it's name tells us, it assigns or say inserts the given properties to the given object.
    As here we are assigning those square, cube etc properties to the Array.prototype object.

    Hope you get it?
    else do let me know, I will give you some examples!

    BTW CLEVER code!

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks will try that :) , and are you still reading it or ?
    and how is your progress now?

  • Custom User Avatar

    what is happening from (.concat, '.concat() wil..................)
    and why and how are we getting ' '(space) for the second argument whereas it should return some value(like e) here?

  • Custom User Avatar
  • Custom User Avatar

    how is this working?

  • Custom User Avatar

    Before starting I did one wonderful thing, that is, started reading comments because I knew this will be really really confusing one, and thank god I did, I got motivated and I didn't even got a little anger all thanks to the people who were encouraging to not to give up, and yeah finally I was able to solve it, but still for you help here's a HINT:

    HINT:
    Try to find the source code of the given function, in that you will find the (answer) or (instructions to pass) or (in simple secret to open that box)...

    you can search how to ..... and you will for sure eventually get to the answer, don't forget to appreciate the creator of this wonderful kata!

    Thanks for this Amazing kata BTW ;)

  • Custom User Avatar
    var titanic = new Ship(15, 10);
    
    Taking into account that an average crew member on board adds 1.5 units to the draft, a ship that has a draft of more than 20 without crew is considered worthy to loot. Any ship weighing that much must have a lot of booty!
    

    Here 1.5 has no relation with the input values, such as 15(draft) and 10(crew) here, so It is kinda formula or a hardcoded value, which you have to use to find the real value of the crews and then removal of that value from total ships value(draft) gives you the required value, which can be used to determine whether to loot it or not?

  • Custom User Avatar

    yup!

    thanks :)

  • Custom User Avatar

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

  • Custom User Avatar

    "should return true for a valid walk

    Log

    [ 'n', 's', 'n', 's', 'n', 's', 'n', 's', 'n', 's' ] 10

    true"

    I am printing three things here, the walk, it's length and return value(answer true or false) and now tell me what is wrong here?

  • Custom User Avatar

    should return true for a valid walk
    [ 'n', 's', 'n', 's', 'n', 's', 'n', 's', 'n', 's' ]

    my answer is true, but it says it should be false but why? (I am using js to solve)

    and how is this one bringing back to the place started?
    [ 'e', 'e', 'e', 'w', 'n', 's', 'n', 's', 'e', 'w' ]

    Thanks :)

  • Custom User Avatar

    You cannot swap the operands. For instance, in the given example you cannot get expression (1 + 3) * 2 = 8.

  • Loading more items...