Can’t we do this by directly printing?
How can I print the elements in sorted order without making arraylist
Is it necessary to make arraylist in this?
- No, we can’t solve this directly by printing because we have to preserve the order of elements.
- We cannot print because the characters are in a random order and we have to preserve the order of characters as well