Givelify interview question

Maximum length of subset that can be formed with equal difference between consecutive elements