Ad
  • Default User Avatar

    Can you give examples of when they don't work?

  • Custom User Avatar

    For Swift

    let longRoutes = [["San Policarpo", "Oras"], ["Balangiga", "Lawaan"], ["Borongan", "Maydolong"], ["Jipapad", "Maslog"], ["Balangkayan", "Llorente"], ["Mercedes", "Guiuan"], ["Taft", "Sulat"], ["Sulat", "San Julian"], ["Arteche", "San Policarpo"], ["Oras", "Dolores"], ["Dolores", "Can-avid"], ["Can-avid", "Taft"], ["San Julian", "Borongan"], ["Maydolong", "Balangkayan"], ["Llorente", "Hernani"], ["Hernani", "General MacArthur"], ["General MacArthur", "Giporlos"], ["Giporlos", "Balangiga"], ["Lawaan", "Salcedo"], ["Salcedo", "Mercedes"], ["Maslog", "Arteche"]]

    XCTAssertEqual(findRoutes(routes: longRoutes), "Jipapad, Maslog, Arteche, San Policarpo, Oras, Dolores, Can-avid, Taft, Sulat, San Julian, Borongan, Maydolong, Balangkayan, Llorente, Hernani, General MacArthur, Giporlos, Balangiga, Lawaan, Salcedo, Mercedes, Guiuan")

  • Custom User Avatar

    Your code does not work properly when the number you are considering is a legitimate 0, in which case you just use the default value.

    [I would also just use a .reduce() without using any mapping for performances - really no point in creating temporary variables here -, but that is as a side note.]

  • Custom User Avatar

    You're absolutely right, thanks for spotting. It looks like another user has already managed to edit it somehow so should be all good now

  • Custom User Avatar

    yes, corrected.

  • Custom User Avatar

    Usually waiting for a few minutes will work.

    Except when it doesn't, but that's also a known CW issue: https://github.com/Codewars/codewars.com/issues/1114

  • Custom User Avatar

    Fixed

  • Custom User Avatar

    xyy

    Do you even know what X to the power of Y means?

  • Default User Avatar

    Do you only speak when asked for an opinion? Judging from the comment above, clearly not.

  • Default User Avatar

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

  • Custom User Avatar

    I've updated the description accordingly.

  • Default User Avatar

    For your request, please see ff:

    assertEquals("Jipapad, Maslog, Arteche, San Policarpo, Oras, Dolores, Can-avid, Taft, Sulat, San Julian, Borongan, Maydolong, Balangkayan, Llorente, Hernani, General MacArthur, Giporlos, Balangiga, Lawaan, Salcedo, Mercedes, Guiuan",
              routes.findRoutes(new String[][]{{"San Policarpo", "Oras"}, {"Balangiga", "Lawaan"}, {"Borongan", "Maydolong"}, {"Jipapad", "Maslog"}, {"Balangkayan", "Llorente"}, {"Mercedes", "Guiuan"}, {"Taft", "Sulat"}, {"Sulat", "San Julian"}, {"Arteche", "San Policarpo"}, {"Oras", "Dolores"}, {"Dolores", "Can-avid"}, {"Can-avid", "Taft"}, {"San Julian", "Borongan"}, {"Maydolong", "Balangkayan"}, {"Llorente", "Hernani"}, {"Hernani", "General MacArthur"}, {"General MacArthur", "Giporlos"}, {"Giporlos", "Balangiga"}, {"Lawaan", "Salcedo"}, {"Salcedo", "Mercedes"}, {"Maslog", "Arteche"}}));
    
  • Custom User Avatar

    Not an issue. Problems coming from your code should be raised as a question ;-)

    Also, 2970 is an ore number.

  • Default User Avatar

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

  • Default User Avatar

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

  • Loading more items...