Can you explain how the index of the arrays specially freq[ ] is working https://ide.codingblocks.com/s/204749
Explain working of code
@kt62495 there are 256 ascii symbols that have their corresponding code from 0 to 255. Now when we create an freq[256] in this freq[i] is basically representation of count of the symbol with code āiā .
In C++ each character have a ascii code as told above and they can be used as a number.
suppose āaā has ascii code 97, when it is written freq[str[k]]++, where str[k]=āaā, translates to freq[97]++.
If this resolves your doubt mark it as resolved.