rushikeshnakhate / HackaThon

Assignments
0 stars 0 forks source link

Labelled Array #11

Open rushikeshnakhate opened 4 years ago

rushikeshnakhate commented 4 years ago

input: the first one corresponding a numeric column and second one corresponding to a label column. Note that the i-th element of the numeric column corresponds to the i-th element of the label column The third inputs should be a positive integer n. Your function should return a list of the n smallest labels corresponding to the n smallest values in the numeric array.

input: numeric = [7,6,5,4,3,2,1] labels = ["a","a","b","b","b","a","a"] n = 6 Outout: ['a', 'a', 'b', 'b', 'b', 'a']