Problem with trees

can you explain this problem , its based on trees :-

I will only describe the problem
If you need to understand the solution also for this you need to open a separate doubt for that.
Huffman coding assigns variable length codewords to fixed length input characters based on their frequencies. More frequent characters are assigned shorter codewords and less frequent characters are assigned longer codewords. All edges along the path to a character contain a code digit. If they are on the left side of the tree, they will be a 0 (zero). If on the right, they’ll be a 1 (one). Only the leaves will contain a letter and its frequency count. All other nodes will contain a null instead of a character, and the count of the frequency of all of it and its descendant characters.

Basically huffman coding is a sort of character compression dictionary which sorts the alphabets based on their frequency in the text.
As we know computer only understands binary language so to encode alphabets we need an encoding scheme. Suppose A is encoded as 0011, B as 0010 etc
Here each letter is taking up 4 bits
We can improve this space efficiency by taking note of those characters which occur most frequently in the text and giving them shorter codes. Like A comes many times in language while X comes least. So we can encode A as 0 and X as 0001101 etc
So Huffman coding creates a tree where the alphabets are leaf nodes and the paths are depicted as binary values. The path from the root till the corresponding alphabet leaf is the code for that alphabet.

image