Please make my comment complete as i don't know how to pass the string argument
i have made a comment plz complete it
@abhay_091
if you want to pass the the first character you can write str[i].charAt(0).
but
if you want to compare which string is lexicographical smaller then there is inbuilt compareTo function for the strings.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.