Microsoft | OnSite | Maximum smaller elements on right
Anonymous User
1129

4 turns, each 45 minutes, all are algorithms.
Could be two puzzles within one session if time allows.

Given a list whose elements are integers, we want the maximum number of smaller integers which are on its right side.
Example:
A = [5, 9, 1, 3, 1, 7, 3]
the numbers of smaller integers which are on its right side: [4, 5, 0, 1, 0, 1, 0]
answer is 5.

Comments (2)