DAYS
HOUR
MINS
SEC
Error
Given a string S, implement Huffman Encoding and Decoding.
Example 1:
Input : abc Output : abc
Example 2:
Input : geeksforgeeks Output : geeksforgeeks
Your task:
You don't need to read input or print anything. Your task is to complete the function decode_file(), which takes root of the tree formed while encoding and the encoded string as the input parameters and returns the decoded string.
Constraints:
2<=S<=1000
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes