Bharti Airtel Interview Question

Sort the string, Count words in the statement