Algorithm · Karat · Medium
You are given access logs grouped by user, where each user's entries list the resources they accessed in order. Using these logs, construct an adjacency list that records, for each resource, the probability of moving from it to each other resource next. Two special states must be included as well: a START state that precedes the first resource each user accesses, and an END state that follows the last one. Examples Example