full implementation of bulid parlindrome string