Pergunta de entrevista da empresa Cisco

Given an array of numbers, find the max length of subsequence such that when the subsequence is sorted, the max difference between adjacent numbers is 1.