Given a log file where each line is formatted as 'timestamp, user, action', count the number of sessions for each user.
Asked in the Onsite stage as a LeetCode-style coding round focusing on string and log processing. Treat each login action as the start of one session; other actions, including logout, do not create additional sessions.
Implement count_sessions(log_lines), where log_lines is a list of strings. Each string contains a timestamp, user, and action separated by commas. Return a dictionary mapping each user to their number of login sessions. Ignore the timestamp when counting.
login after trimming whitespacedef count_sessions(log_lines):