Infosys BPM Interview Question

longest subsequence sum equal to k