← 返回 amazon 的题目列表URL Access Table Pathfinding
类型:online_judge
Given a table recording user id, initial url, and destination url, provide a function to determine if url_1 can access url_2. Assume that connections between URLs can only be deduced from direct records in the table.
Input/Output
Input:
Task table table, each record includes:
userId: user ID
from_url: initial URL
to_url: destination URL
Output:
Boolean indicating whether there is a path connecting them.
Example
Table example:
| userId | from_url | to_url | |--------|----------|--------| | 1 | url_1 | url_2 | | 2 | url_2 | url_3 |
Function call: determine if url_1 can access url_3.
Output: True
Example
Input
Generate input based on example provided