Nov 4, 2018 01:44 AM
(This post was last modified: Nov 4, 2018 01:45 AM by MelonbreadHF.)
Hey there, I'm attempting to solve a hackerrank problem and I've gotten to a point where I'm getting 4/7 test cases that are succeeding and the test cases are that are failing don't really let you debug why its failing. I'm assuming that my code may be missing some edge cases but I can't seem to figure whats wrong with it. Also I'm attempting to solve the problem with C++, even though I am more familiar to C# so I may be prone to a logic error that I don't know of that works differently between these two languages.
Anyhow, the problem has to do with Huffman Encoding/Decoding. Here is a sample on how the input/output should work.
i.gyazo.com/734fe0907524dd48ca3316695e436ca4(dot)png - I can't post links :<
They give you a string function to fill out, and they give you the following parameters: codes (in a vector array), and the encoded string. That string should return the decoded message like the sample above.
Here's my code: Pastebin(dot)com/ -> 4qmsjtEn - I can't post links :<
Hackerrank just gives you the "string decode(vector<string> codes, string encoded)" function.
Anyhow, the problem has to do with Huffman Encoding/Decoding. Here is a sample on how the input/output should work.
i.gyazo.com/734fe0907524dd48ca3316695e436ca4(dot)png - I can't post links :<
They give you a string function to fill out, and they give you the following parameters: codes (in a vector array), and the encoded string. That string should return the decoded message like the sample above.
Here's my code: Pastebin(dot)com/ -> 4qmsjtEn - I can't post links :<
Hackerrank just gives you the "string decode(vector<string> codes, string encoded)" function.

