You are given an array restaurants where restaurants[i] = [id_i, rating_i, veganFriendly_i, price_i, distance_i]. You are also given the filtering criteria veganFriendly, maxPrice, and maxDistance.
Filter the restaurants based on the following conditions:
If veganFriendly equals veganFriendly_i equals veganFriendly equals veganFriendly_i value.
Only select restaurants where price_i \leq maxPrice.
Only select restaurants where distance_i \leq maxDistance.
Return the list of id values of the filtered restaurants, sorted by rating in descending order. If multiple restaurants share the same rating, sort them by id in descending order.
Constraints:
restaurants.length
restaurants[i].length
id_i, rating_i, price_i, distance_i
maxPrice, maxDistance
veganFriendly_i and veganFriendly are either
All id_i are distinct.
You are given an array restaurants where restaurants[i] = [id_i, rating_i, veganFriendly_i, price_i, distance_i]. You are also given the filtering criteria veganFriendly, maxPrice, and maxDistance.
Filter the restaurants based on the following conditions:
If veganFriendly equals veganFriendly_i equals veganFriendly equals veganFriendly_i value.
Only select restaurants where price_i \leq maxPrice.
Only select restaurants where distance_i \leq maxDistance.
Return the list of id values of the filtered restaurants, sorted by rating in descending order. If multiple restaurants share the same rating, sort them by id in descending order.
Constraints:
restaurants.length
restaurants[i].length
id_i, rating_i, price_i, distance_i
maxPrice, maxDistance
veganFriendly_i and veganFriendly are either
All id_i are distinct.