• + 0 comments

    nope i read it correctly first time, its "any pair" not just the number next door. so for 4,3,3,2,2,1 your best choice is {3,3,2,2} since 4 is more then 1 away from 2 and 1. this subset choice would be the same completely ignoring the order the numbers appear. so 3,1,2,4,2,3 is essentially the same problem as above