← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of system login log entries logs, where logs[i] = [ip, machine, status]:
ip: the client IP address.machine: the hostname the client attempted to log into.status: either "failed" or "success".
Return a list of every IP that has at least one failed login attempt, sorted in descending order by total failed attempt count. Break ties by IP address in ascending lexicographic order.
The machine field is part of the log format but is not used in the return value.10.0.0.2 had 3 failed attempts and 192.168.1.1 had 2, so 10.0.0.2 comes first.
Both IPs have 1 failed attempt. The tie is broken alphabetically, so 10.0.0.1 comes first.