Algorithm · Airbnb · Medium
Design a function parse_url(url) that deconstructs a URL string into its core components. Additionally, implement a helper function unquote that decodes percent-encoded sequences. The parser must extract the following pieces, returning null for any component that is not present: scheme — the protocol (e.g., http, https) host — the host name port — the port number path — the path; default to "/" when missing query — query parameters, represented as an ordered list of [key,…
Checking your access…