Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Let's find for every user separately the websites he visited.
Consider all possible 3-sequences, find the number of distinct users who visited each of them.
How to check if some user visited some 3-sequence ?
Store for every user all the 3-sequence he visited.