TATA ELXSI Interview Question

Reverse string and count the number of sub string.