Ad
  • Custom User Avatar

    Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

  • Custom User Avatar

    Could you explain to me (s.length / 2 - 1) ? To me it is saying find the middle and move the index down one in case it is an even number string length so you can return both numbers. I don't get it, I do understand the deprication of substr and I used substring in my solution. Or if you could maybe explain what the (s.lenght / 2) - 1 means that will help as well.

  • Custom User Avatar
    • No random tests (must also generate cases below)

    • Missing fixed, sample tests for valid cases below:

      • ########## ext. # (3-digit areacode + 3-digit local3 + 4-digit last4 + extension)
        --> aF[}2654871290D~]:gF;X012345

      • Above case with leading 1 --> wV: 15754437619At,xfD90 (Note: 1575 with leading 1)

      • 1(###) ###-#### (1 followed immediately by 3-digit areacode + 3-digit local3 + 4-digit last4)

        --> a1234-567AbCd8901~:)SD

      • (###) ####### ext. # (3-digit areacode + 7-digit combined (3-digit local3 + 4-digit last4) + extension)

        --> !046f*S;b J2634114 extensio91243445445

      • Above case with leading 1 --> !1046f*S;b J2634114 extensio91243445445 (Note 1046 instead of 046)

      • (###)### #### ext. # (6-digit combined (3-digit areacode + 3-digit local3) + 4-digit last4 + extension) --> 254780gR]}\~fdn dA1234zyXtdfd01234567

      • Above case with leading 1 --> 1254780gR]}\~fdn dA1234zyXtdfd01234567 (Note 1254780 instead of 254780)

  • Default User Avatar

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

  • Default User Avatar

    A string also has a length property. Don't need to convert the string to an array with split().

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Diagonal lines are tested, but the line drawing algorithm is not specified. There are at least several possible line drawing algorithms.

  • Custom User Avatar

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

  • Default User Avatar

    Does this kata require any specific node.js functionality?

  • Custom User Avatar

    Good code, but unnecessarily big.
    No need to use Math.ceil (if you don't use decimal numbers) and ternary operator.
    Check my solution.

  • Custom User Avatar

    Thanks! Mine was so ugly compared to this.

  • Custom User Avatar
    • Should explicitly mention that coordinates given will always be valid

    • Should also mention that points constituting towards diagonal or not fully-straight lines will be tested

    • Node 18. and chai assertions should be used

    Otherwise, a good kata!

  • Default User Avatar

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

  • Default User Avatar

    Great solution! This is a good way for finding the middle value for sure. I will incorporate this into my code in the future!

  • Loading more items...