Amazon interview question

maximum subset problem