Given an array of countries, sorted according to their land area. Complete the definition of getCountries
function to return the original array of countries intact and an array that contains ith
largest to jth
largest countries.
Rank (Land Area) | Index | Country |
---|
1st | 0 | Russia |
2nd | 1 | Canada |
3rd | 2 | China |
4th | 3 | United States |
5th | 4 | Brazil |
6th | 5 | Australia |
7th | 6 | India |
8th | 7 | Argentina |
9th | 8 | Kazakhstan |
10th | 9 | Algeria |
- The strings
i
& j
will be of the format (1st, 2nd, 3rd etc)
- The countries' array will be constant for all test cases.
For example: