Posted on

Algorithm to match numbers with minimum number of moves

Problem Detail:  This is a sort of edit-distance question, and is very easy. I am just quite brain dead on this subject and can’t figure it out so far. Given a series of numbers, e.g. [3, 1, 1, 1] How would one most efficiently turn all of the numbers into the same number, with the…

Read more