Ad
  • Default User Avatar

    This is the problem I'm stuck on, I don't think this is actually completeable. using my IDE I coded up this:
    List al1= Arrays.asList();
    List al2= Arrays.asList();
    pln(""+al1+al2); //[][]
    pln(""+(al1==al2)); //false
    pln((Arrays.asList()==Arrays.asList())+""); //false
    Java will always compare the references here and not the content so idk how people passed this in java

  • Default User Avatar

    All test ran successfully except three which is returning [
    // assertEquals(Arrays.asList(), RepeatingWord.findWord(" ... "));
    // assertEquals(Arrays.asList(), RepeatingWord.findWord(" ' "));
    // assertEquals(Arrays.asList(), RepeatingWord.findWord(" ''' "));

    Getting error of comparison of
    org.opentest4j.AssertionFailedError: expected: java.util.Arrays$ArrayList@5abca1e0<[]> but was: java.util.ArrayList@2286778<[]>
    how ever i am using comparator and in comparison its giving error in unit test only.

  • Default User Avatar

    yes actually, missed one test case. thanks

  • Custom User Avatar

    @qy201706 Instead of changing the function parameter,
    construct a std::string from the input in within your function.

    For instance, use:

    string in_string(in);
    

    should give an in_string string object which you can use to examine for duplicates.

  • Default User Avatar

    the test is the alphabet in lowercase and uppercase... there are 26 letters in the alphabet

  • Default User Avatar

    abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZReturnsTwentySix

    How its expecting 26? It should be 13