Problem C - Largest Score Pattern (3 extra points) (Optional): Given three arrays of the same length: username, website, and timestamp, where each tuple ii represents that the user username[i] visited the website website[i] at the time timestamp[i]. A pattern is a list of three websites, not necessarily distinct. The score of a pattern is the number of users that consecutive visited all the websites in the pattern in the same order they appeared in the pattern (see more explanation in section:Hints). The task is to find the pattern with the largest score, and if there are multiple patterns with the same score, return the lexicographically smallest pattern. Problem definition: the task is to implement a function find_largest_pattern(username: List[str], timestamp: List[int], website: List[str]) -> List[str]: that takes three arrays of strings usernane, website, and an array of integers timestamp, and returns a list of three strings, representing the pattern with the largest score. Function parameters: - username : a list of strings representing the usernames of the users who visited the websites. - timestamp : a list of integers representing the timestamps at which the users visited the websites. - website : a list of strings representing the names of the websites visited by the users. Return: - List[str]: a list of three strings representing the website pattern with the largest score. Example 1: Input: username = ["bob", "bob", "bob", "john", "john", "john", "john", "mike", "mike", "mike"], timestamp =[1,2,3,4,5,6,7,8,9,10] nebsite - ["song", "page", "faq", "song", "cart", "maps", "song", "song", "poge", "faq"] Output: ["song", "page", "faq"] Explenation: The tuples in this example are: ["bob", "song", 1], ["bob", "poge", 2], ["bob", "faq", 3], ["john", "song", 4], [ "john", "cart", 5], ["john", "maps", 6], ["john", "song", 7], ["mike", "song", 8], [ "mike", "page", 9], and [ "mike", "faq", 10]. The pattern ["song", "page", "faq"] has score 2 (bob and mike). The pattern ["song", "cart", "maps"] has score 1 (john). The pattern ["song", "cart", "song"] has score 1 (john). The pattern ["song", "maps", "song"] has score 1 (john). The pattern ["cart", "maps", "sang"] has score 1 (john). The pattern ["song", "song", "song"] has score 6 (no user visited song 3 times). Constraints: - It is guaranteed that there is at least one valid pattern in the input - You can assume that given lists are always sorted by the timestamp - The websites in the pattern must be visited by a user continuously (user-wise) for a score. For example, John visited ["song","cart","maps","song"]; then, we cannot say ["song","maps","song"] is a visited pattern of John, since John also visited "cart" in-between "song" and "maps". - Continuous visits are defined user-wise. For example, John visited ["song","cart","maps","song"] at timestamp [1,2,3,5], and another user Bob visited ["cart"] at timestamp [4]. This will not break the continuity of pattern ["cart","maps","song"] Hints: - This problem is not closely related to graph theory. Think of it more in terms of OTHER data structures
between cities. Your task is to find out all the path combinations to travel from one given city to another. Problem definition: Implement the function called: find_paths(connection: List[List[int]], source: int, destination: int) ?L ist [List[int]], to return a list including all paths from the city source to the city destination. You may return them in any order. If the path does not exist, return an empty list. Note that we use the number (int) as the name of the city. Function parameters: : a list with length N, where N is the number of paths involved in this connection map. Each sublist in [u,v], indicates that there is a path from the city u to city v. - source: an integer that represents the name of the city. - an integer that represents the name of the city. Return : - : a List stores all paths from city source to city destination. Each path should be represented as a list of the city name. Example 1: Input: connection =[[6,1],[0,4],[1,2],[2,3],[3,4]] source =2 destination =1 Output: Q Explanation: There is no path connection fron city 2 to city 1 Example 2: Input: connection =[[0,1],[1,2],[1,3],[1,5],[2,3],[2,4],[3,4],[4,5],[0,5]] source =1 destination =5 Output: [[1,2,3,4,5],[1,2,4,5],[1,3,4,5],[1,5]] Explanation: three paths: 1?3?4?5 and 1?2?3?4?5 and 1?5 Constraints: - Input and destination are different numbers, i.e., ?= - Input and destination can always be found in the given connection map - All cities (vertices) in the connection map are unique Hints: - The connection is a DAG, i.e., directed and acyclic. - The input connection is not sorted.