We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I am not talking of the sample input provided. But I Downloaded the 4th test case(for 5 hackos) while final running. Seeing the Input and Output, it was Matching,which is as expected. But I am getting wrong answer.
Match the output for the test case with your output for that case by running it on a custom test case with the input of that test case. The output of your code should match the output, not the input and the output.
I think I am not able to make myself clear. My code runs fine for test cases 0-3 but gets a wrong answer for the 4th test case. I downloaded the test case (for 5 hackos). It has 2 options named as "INPUT" and "OUTPUT" and both contain the same string, which leads me to say that the INPUT and OUTPUT are same. Also, as provided in the sample test case:
Input (stdin)
ABACA
Your Output (stdout)
ABACA
Expected Output
ABACA
Here the ouput of my code matches the Input as well as the Expected Output and I get a correct answer. But how do I see the expected OUTPUT for the 4th test case that I am failing(WA). Even after downloading, I see the same string as "HackerRank" in the input and output sections. Please help me debug. Thanks
The input has nothing to do with your code. It is being used to generate the encoded string. Run your code for a custom testcase with "HackerRank" and see the output for your program.
Run your program using the "Test against custom input" option and give the input as "HackerRank". Check the output there. That is the output of your program. You don't have to do anything with the input. The input is being used to generate the encoded string by the main program.
Tree: Huffman Decoding
You are viewing a single comment's thread. Return to all comments →
I am not talking of the sample input provided. But I Downloaded the 4th test case(for 5 hackos) while final running. Seeing the Input and Output, it was Matching,which is as expected. But I am getting wrong answer.
Match the output for the test case with your output for that case by running it on a custom test case with the input of that test case. The output of your code should match the output, not the input and the output.
I think I am not able to make myself clear. My code runs fine for test cases 0-3 but gets a wrong answer for the 4th test case. I downloaded the test case (for 5 hackos). It has 2 options named as "INPUT" and "OUTPUT" and both contain the same string, which leads me to say that the INPUT and OUTPUT are same. Also, as provided in the sample test case:
Input (stdin) ABACA
Your Output (stdout) ABACA
Expected Output ABACA
Here the ouput of my code matches the Input as well as the Expected Output and I get a correct answer. But how do I see the expected OUTPUT for the 4th test case that I am failing(WA). Even after downloading, I see the same string as "HackerRank" in the input and output sections. Please help me debug. Thanks
The input has nothing to do with your code. It is being used to generate the encoded string. Run your code for a custom testcase with "HackerRank" and see the output for your program.
The output is "HackerRank" ran using custom input as "HackerRank" and the same code is getting WA on test case#4. What is the expected output?
Run your program using the "Test against custom input" option and give the input as "HackerRank". Check the output there. That is the output of your program. You don't have to do anything with the input. The input is being used to generate the encoded string by the main program.
The output is also "HackerRank", when ran on "Test against custom input". Is it correct?