Sort:  

This is not a correct way of solving this problem You have to find the length of A