Back to problems

Minimum Clicks Between Wiki Pages

Algorithm · Snowflake · Medium

A wiki is made up of pages that link to one another. Given a startPage and a targetPage, determine the smallest number of link clicks required to travel from the start page to the target page. You must also provide a mechanism for reading a page's outgoing links. For instance, you may represent the wiki as an in-memory directed graph and expose a function such as getLinks(page), which returns the list of pages that page links to directly. The rules are as follows. Every…

Checking your access…