Browser tab content: # HackerRank

The editor of a sports magazine must create a list of elite clubs in a nation. Use HTTP GET requests to access a database for football clubs (i.e., soccer clubs) via the URL _https://jsonmock.hackerrank.com/api/football\_teams?nation={nation\_name}_. The database contains the estimated monetary value of each club, referred to as _valuation_. The query result is paginated and can be further accessed by appending _&page={num}_ to the query string where _num_ is the page number.

The query response from the API includes these fields:

-   _page:_ the current page
-   _per\_page:_ the maximum results per page
-   _total:_ the total number of records
-   _total\_pages:_ the total number of pages for the query
-   _data:_ an array of JSON objects containing club information

Each object in the data field includes the following:

-   _name:_ the club's name
-   _nation:_ the nation in which the club plays
-   _estimated\_value\_numeric__:_ the monetary value of the club
-   _number\_of\_league\_titles\_won__:_ the number of league titles won by the club
-   other details not relevant to this question

For example, the record for Arsenal FC is:

```
  {
    "name": "Arsenal FC",
    "captain": "Pierre-Emerick Aubameyang",
    "vice_captain": "Alexandre Lacazette",
    "goalkeeper": "Bernd Leno",
    "number_of_players": 25,
    "current_active_players": 22,
    "league": "English Premier League (EPL)",
    "nation": "England",
    "estimated_value": "$2 billion",
    "estimated_value_numeric": 2000000000,
    "number_of_league_titles_won": 13,
    "last_league_title_winning_year": 2003,
    "number_of_champions_league_won": 0,
    "last_champions_league_winning_year": null,
    "total_silverware_count": 30,
    "manager": "Mikel Arteta",
    "stadium_name": "Emirates Stadium",
    "stadium_capacity": 60355,
    "league_position_2021": 5,
    "league_top_three_finishes": 18,
    "number_of_runner_ups_in_champions_league": 0,
    "highest_goalscorer": "Thierry Henry",
    "highest_assist_provider": "Thierry Henry",
    "highest_clean_sheet_holder": "David Seaman",
    "most_capped_player": "Tony Adams",
    "appearances_most_capped_player": 669
  },
```

Given the minimum valuation and the minimum number of league titles that a club must win to join the list of elite clubs, return an array of elite clubs in the given nation. Sort the array in decreasing order of valuation. If the valuation is the same for multiple clubs, sort them further in ascending alphabetical order.

**Function Description**

Complete the function _eliteClubs_ in the editor below.

_eliteClubs_ has the following parameter(s):

   string _nation:_ the nation's name

   int _minValuation:_ the minimum valuation required to be considered an elite club

   int _minTitlesWon:_ the minimum number of league titles won to be considered an elite club

**Returns**

    _string\[\]:_ the name(s) of all the elite clubs in the nation

**Note:** Please review the header in the code stub to see available libraries for API requests in the selected language. Required libraries can be imported to solve the question. Check our full list of supported libraries at [https://www.hackerrank.com/environment](https://www.hackerrank.com/environment).

Input Format For Custom Testing

The first line contains a string, _nation_.  
The second line contains an integer, _minValuation._

The third line contains an integer, _minTitlesWon._

Sample Case 0

Sample Input For Custom Testing

England
823472
2

Sample Output

Manchester United FC
Chelsea FC
Manchester City FC
Liverpool FC
Arsenal FC
Tottenham Hotspur FC
Everton FC
Wolverhampton Wanderers FC
Aston Villa FC
Burnley FC
Leeds United FC
Newcastle United FC
Fulham FC
Blackburn Rovers FC
Derby County FC
Birmingham City FC
Queens Park Rangers FC
Huddersfield Town AFC
Coventry City FC
Preston North End FC
Hull City AFC
Luton Town FC
Bolton Wanderers
Charlton Athletic

Explanation

There are 24 clubs with a minimum valuation of 823472 and a minimum of 2 league titles won in England.

Sample Case 1

Sample Input For Custom Testing

Wales
660905
1

Sample Output

Cardiff City FC

Explanation

Only Cardiff City FC meets the criteria for valuation (at least 660905) and titles won (at least 1) to be considered an elite club in Wales.

Remove distracting text, extract the programming question, provide simple, common, and optimized Java solution for it.