general method to detect int palidrome