Loading Similar Posts
Problem Statement:
A stock trader trades in N selected stocks. The trader has calculated the relative stock price changes in the N stocks from the previous day's stock prices. The trader's lucky number is K, so the trader wants to invest in the particular stock that has the Kth smallest relative stock value.
Write an algorithm for the trader to find the Kth smallest stock price among the selected N stocks.
Input Format:
Sample Test Case 1:
Input:
7
1 2 3 4 5 7 9
4Output:
4