Count User Logins 🌿 (Singapore)
A company wants to track the usage of its mobile app by recording users' login times and dates. The company stores the login information in a 2D array of strings, logs, which contains data in the format ["/username<user_id>","login_time","login_date"].
They need a function to process the logs and output a 2D array of strings, sorted lexicographically, that displays the number of times each user logs in per day in the format ["/username<user_id>","login_date","login_count"]. It must filter invalid data in the input array rather than write it to the output array.
Users should be sorted in lexicographic order based on their user_id. Each user's information should be sorted by the login date in ascending order. The date and time are provided in YYYY-MM-DD and HH:MM:SS format, and the username has the format "userX" where X is an integer.
Complete the function countUserLogins in the editor.
countUserLogins has the following parameter:
String[][] logs: a 2D array of strings containing the login data
Returns
String[][]: a 2D array of strings containing the user login counts per day, sorted lexicographically
1Example 1

[["user1","2021-01-01","3"],["user1","2021-01-02","1"],["user2","2021-01-01","1"]].2Example 2
Constraints
Limits and guarantees your solution can rely on.
1 ≤ n (size of logs) ≤ 10^52000 ≤ YYYY ≤ 30000 ≤ MM, DD, HH, SS ≤ 99