Dominant Trade Price
Zupee interview questions · Easy · Coding round · 7 tests
An analytics service for traders records the prices at which a single stock's trades were filled over some time window. These prices are kept in an array that is sorted.
We say a price is dominant when it accounts for strictly more than half of the executions in that window.
Given the sorted array prices, return the dominant price when there is one, and
null when there is not.
Run your code with Ctrl+Enter to see results.