Ad
  • Custom User Avatar

    Not really the same issue.
    For yours, you just have to consider it goes back to 6.
    Even negative indexes could be defined that way.

  • Custom User Avatar

    Additionally, the return value is unspecified if all of the letters are shared between the two names (such as LIAM/MILA, CLAY/LACY, ROAN/NORA, etc.).

    Based on the reference solution, "Siblings" should be returned, but the description uses 1-based indexing, meaning that an index of 0 should be undefined.

  • Custom User Avatar

    It loops back to 1

  • Custom User Avatar

    Description has to state explicitly what to do with names with multiple occurences of common letters.
    Take the following example:

    show_relationship('KEVIN', 'ANN') == "Enemies"
    KEVIN and ANN have character `N` in common.
    You must cross out all Ns in both names: 1 in KEVI~N~ and 2 in A~NN~.
    After this step, only 5 letters remain.
    
  • Custom User Avatar

    Approved some time ago

  • Custom User Avatar

    One of the easiest to understand imo

  • Custom User Avatar

    I think there's a problem with the randomized test. Cause it says on the log:
    HSREBQTK
    FLLCG
    13
    1
    We get the value 1 which obviously corresponds to "Friendship" but an error occurs and says:
    expected:<[Siblings]> but was:<[Friendship]>
    although on previous randomized test with the same result:
    KRK
    BOOZJDTZVI
    13
    1
    There is no error
    Please fix this.

  • Custom User Avatar

    Indeed, and in fact what is the expected outcome of that?

    Since the F is counted as the first step, what should we consider "step 0"?

  • Custom User Avatar

    random tests added

  • Custom User Avatar

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

  • Custom User Avatar

    What happens if the total remaining characters > 6 ?

  • Custom User Avatar

    Theres more too it than that bud. Follow the logic. You're saying everything that's not 0 and divisable by 3 is Java.

    What about Coffe, CoffeeScript, and Javascript?

    if (n != 0) {
          if (n%3==0 && n%4 != 0) {
            if(n%2==0)  {
              return "JavaScript";
            }
            else {
              return "Java";
            }
          
          }  // not devis 4
          
          else if (n%3==0 && n%4==0) {
            if(n%2==0) {
              return "CoffeeScript";
            }
            else {
              return "Coffee";
            }
            
          } // devise form  
              
        } // MAIN IF
        
        
        return "mocha_missing"; // ELSE!!!!!!!!!!!!!!!!!!
    
  • Custom User Avatar

    You really need randomized tests to make all these hard-coded implementations to fail.

  • Custom User Avatar

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

  • Custom User Avatar

    Two test cases don't seem to evaluate properly.

  • Loading more items...