Object-Oriented Programming · Palantir · Medium
Given a country and a phone number, use the API at https://jsonmock.hackerrank.com/api/countries?name=country to retrieve the country's calling codes. Add the calling code before the phone number and return the resulting string. When the API's data array is empty, return '-1'. If more than one calling code is available, select the code at the greatest array index. Format the result as follows: For example, a formatted result can look like this: The API response is a JSON…