Maximize palindromic strings after character swaps | IBM Interview Question