Case Time Limit:3000ms
In a running system, there are many logs produced within a short period of time, we’d like to know the count of the most frequent logs.
Logs are produced by a few non-empty format strings, the number of logs is N(1<=N<=20000), the maximum length of each log is 256.
Here we consider a log same with another when their edit distance (see note) is <= 5.
Also we have a) logs are all the same with each other produced by a certain format string b) format strings have edit distance 5 of each other.
Your program will be dealing with lots of logs, so please try to keep the time cost close to O(nl), where n is the number of logs, and l is the average log length.
Note edit distance is the minimum number of operations (insertdeletereplace a character) required to transform one string into the other, please refer to
http://en.wikipedia.orgwikiEdit_distance for more details.
Multiple lines of non-empty strings.
The count of the most frequent logs.
- Sample Input
Default12345Logging started for id:1Module ABC has completed its jobModule XYZ has completed its jobLogging started for id:10Module ? has completed its job
- Sample Output
本文链接地址: Microsoft Online Test for Core Technical Positions 4: Most Frequent Logs
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。