Refined problem1
Adding palindrom check
Solving problem n°4