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.
took some time to debug and understand it. The empty data is represented as string: chr(0) which is NUL in ascii.
defdecodeHuff(root,s):#Enter Your Code Herehead=rootforbins:ifb=='0':head=head.leftifhead.data!=chr(0):print(head.data,end='')head=rootelse:head=head.rightifhead.data!=chr(0):print(head.data,end='')head=root
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Huffman Decoding
You are viewing a single comment's thread. Return to all comments →
took some time to debug and understand it. The empty data is represented as string: chr(0) which is NUL in ascii.