Algorithm · PayPal · Medium
You are reading a special kind of book where some pages present a choice. When you reach a page that contains a choice, you must pick one of two possible next pages, and the story continues from there. Otherwise, you simply read the pages in order: page 1, then page 2, then page 3, and so on. A choice is represented as a triplet [current_page, option1_page, option2_page]. All choices are given in a list, sorted by current_page. For example, [3, 14, 2] means that page 3…
Checking your access…