Simon AI Interview Question

Given an array, increment any duplicate values until every element is unique. Return the minimum sum of elements for the unique array.

Interview Answers

Anonymous

May 25, 2020

May be this can be done easily with recursion or some optimized method. Here is easy answer. array=[1,1,1,1] u_array=[1,2,3,4] def uniquearry(array): array.sort() while len(set(array))

Anonymous

May 25, 2020

May be this can be done easily with recursion or some optimized method. Here is easy answer. array=[1,1,1,1], u_array=[1,2,3,4] def uniquearry(array): array.sort() while len(set(array))

Anonymous

May 25, 2020

May be this can be done easily with recursion or some optimized method array=[1,1,1,1] u_array=[1,2,3,4] def uniquearry(array): array.sort() while len(set(array))