Coding for palin and finding the position of a number