Pergunta de entrevista da empresa LinkedIn

3) For a given array find the maximum size palindrome subset. The subset may be not continues. For input 1, 2, 4, 5, 1 the answer is 3, the subset is 1,2,1