Your question is Login Attempts Log Problem. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a log file of login attempts (each line has status failed/accept, the user who tried to log in and the IP), output the IPs for the user 'hacker' whose attempts have status failed.
Asked in the phone screen stage. Coding problem at the end of the screen.
Implement failed_hacker_ips(log_lines). log_lines is a list of whitespace-separated strings in the format status user ip. Return a list of matching IP strings in their original order. Preserve duplicate IPs. Every input line has exactly three fields and a status of failed or accept.
def failed_hacker_ips(log_lines):