NewThe Learning module is now liveSee what's new

(This question is a variation of the LeetCode question 208. Implement Trie (Prefix Tree). If you haven't completed that question yet, it is recommended to solve it first.)

You are given a list of user action logs logs, where each log entry is a list of exactly three strings: [userId, timestamp, action]. The timestamp is a numeric string used only for ordering. For each user, their actions must be processed in ascending order of the integer value of timestamp, not lexicographic order. Each user has distinct timestamp values.

Build a User Journey Trie from all users' action sequences. For each user, their sorted actions form one path in the Trie. Each Trie node represents an action at a specific depth. The count of a node is the number of distinct users whose journey passes through that exact prefix.

Return a list of strings representing the Trie, where each string represents one node with the following formatting rules:

Test Cases
Input
Output
Expected