Members Lacking Provider Network Access
You are given a list of providers and a list of members.
Each provider row is encoded as [providerId, specialty, x, y]. Each member row is encoded as [memberId, x, y, requiredSpecialties], where requiredSpecialties is a pipe-delimited string such as "Cardiology|Dermatology".
A member lacks adequate provider network access if there exists at least one required specialty for which no provider of that specialty lies within maxDistance of the member.
Use Euclidean distance. Return the ids of all members who lack adequate access in ascending order.
Complete the function findMembersLackingAccess in the editor below.
findMembersLackingAccess has the following parameters:
String[][] providers: provider rows[providerId, specialty, x, y]String[][] members: member rows[memberId, x, y, requiredSpecialties]int maxDistance: the maximum allowed Euclidean distance
Returns
int[]: the ids of members lacking adequate access, sorted ascending.
1Example 1
Member 101 has both required specialties within distance 5. Member 102 has no nearby cardiology provider.
2Example 2
Member 1 is exactly distance 5 from the cardiology provider, so access is adequate. Member 2 requires dermatology, which is unavailable.
Constraints
Limits and guarantees your solution can rely on.
1 <= providers.length, members.length <= 10^5- Coordinates are numeric values stored as strings in the encoded input.
- A member is reported if any required specialty is missing within
maxDistance. - The answer must be sorted ascending for deterministic output.