Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
In the description :
Why it should be [2, 3] instead of [1, 3] ?
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.
/GraphTest.java:126: error: cannot find symbol
It seems like the test case has some problems...
This comment is hidden because it contains spoiler information about the solution
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?
okay... = =
I understand now, thank both of you :D
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?
alright, thanks
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
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)?
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?
lol
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));
Just take it, I dont mind :-)
Loading more items...