# Analyze User Website Visit Pattern

``````class Solution {
class Pair {
int c;
String s;
public Pair(String s, int c) {
this.s = s;
this.c = c;
}
}
class Triple {
int t;
String s;
String w;
public Triple(String s, int t, String w) {
this.s = s;
this.t = t;
this.w = w;
}
}
public List<String> mostVisitedPattern(String[] username, int[] timestamp, String[] website) {
List<Triple> t = new ArrayList<>();
for(int i = 0; i < n; i++) {
}
Collections.sort(t,(a, b) -> (a.t-b.t));
Map<String, List<String>> map = new HashMap<>();
for(Triple tt : t) {
map.putIfAbsent(tt.s, new ArrayList<>());
}
Map<String, Set<String>> countMap = new HashMap<>();
for(Map.Entry<String,List<String>> e : map.entrySet()) {
countMap.putIfAbsent(e.getKey(), new HashSet<>());
}
Map<String, Set<String>> countMapRev = new HashMap<>();
for(Map.Entry<String,Set<String>> e : countMap.entrySet()) {
for(String s : e.getValue()){
countMapRev.putIfAbsent(s, new HashSet<>());
}
}
List<String> res = new ArrayList<>();
PriorityQueue<Pair> pq = new PriorityQueue<>((a, b) -> (a.c == b.c ? a.s.compareTo(b.s) : b.c - a.c));
for(Map.Entry<String,Set<String>> e : countMapRev.entrySet()) {
}
String ss = pq.poll().s;
String[] strs = ss.split("-");
for(String s : strs)
return res;
}
private Set<String> getSeq(List<String> myArray) {
Set<String> res = new HashSet<>();
for(int i = 0; i < myArray.size() - 2; i++) {
for(int j = i + 1; j < myArray.size() - 1; j++) {
for(int k = j + 1; k < myArray.size(); k++) {
}
}
}
return res;
}
}
``````