Ad
  • Default User Avatar

    In the description :

    String matrixAsString = "0 1\n 2 3";
    Matrix matrix = new Matrix(matrixAsString);
    matrix.getColumn(1);
    Expected : [2, 3]

    Why it should be [2, 3] instead of [1, 3] ?

  • Default User Avatar

    In Java,

    t : 331 k : 2
    [74, 73, 85, 73, 81, 87]

    Expected: 178

    I wonder how to come up with this answer.

    178 - 74 = 104 (not found in the array)

    178 - 73 = 105 (not found in the array)

    178 - 85 = 93 (not found in the array)

    178 - 73 = 105 (not found in the array)

    178 - 81 = 97 (not found in the array)

    178 - 87 = 91 (not found in the array)

    It seems to me that there is no way to have a subset which the sum of it is 178 in this situation.

  • Default User Avatar

    /GraphTest.java:126: error: cannot find symbol

    It seems like the test case has some problems...

  • Default User Avatar

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

  • Default User Avatar

    I passed all test cases except the random test case.

    My answer is always one more than the expected.

    Is there something wrong with the random test?

  • Default User Avatar
  • Default User Avatar

    I understand now, thank both of you :D

  • Default User Avatar

    In Java, one of the test case is :

    Text : uryrtkzp

    Expected : U663

    But one of the rules is :

    Replace all adjacent same digits with one digit.

    Did I miss something?

  • Default User Avatar
  • Default User Avatar

    Hi, I think there is something wrong with the last test case, I might be wrong though...

    PlainText : Spy kit
    Password : GREAT

    for the third char : 'y' in plainText should match with 'E' in Password, right?

    y's binary form : 0000000001111001
    E's binary form : 0000000001000101
    E's binary form(after replace) : 0100010100000000

    XOR Operation of y's binary form and E's binary form (afer replace) :
    0000000001111001
    0100010100000000
    = 0100010101111001 (17785 in decimal)

    But the test case expects the third char to be (char) 21113

  • Default User Avatar

    What I want to ask is :

    Is

    plainChar XOR passChar

    or

    passChar XOR plainChar

    When you say replace first last 8 bit of "second char" in special XOR, do you mean the latter (the char after XOR)?

  • Default User Avatar

    Special XOR = doing XOR between 2 chars only that the second char's first 8 bits(from the left) are replaced with it's last 8 bits(the right ones).

    what is the 'second char' means? Is it always the password's char here?

  • Default User Avatar
  • Default User Avatar

    I think it might be because we are using different version of java. I dont see this error while running the code..

    Perhaps you can try:

    stack.set(l,""+(Double.parseDouble(stack.get(l)) * -1));

    instead of

    stack.set(l,String.valueOf(Double.parseDouble(stack.get(l)) * -1));

  • Default User Avatar

    Just take it, I dont mind :-)

  • Loading more items...