Count the occurrence of 'Boomerang' sequences in a given list of integers.
Write a python function `count_boomerang_sequences`, that receives a list of integers as input, identifies and counts the "boomerang" sequences in that list. A **boomerang sequence** is a subsection of the list containing exactly three integers where the first and last numbers are identical, while the middle one is different. Examples include: `[3, 7, 3]`, `[1, -1, 1]`, and `[5, 6, 5]`. ### Parameters - `nums` (list): The list of integers to analyze. ### Return Value - Returns the total count of boomerang sequences in the provided list. ### Examples ```python # The list has 3 boomerang sequences: [3,7,3], [1,5,1], [2,-2,2] count_boomerang_sequences([3, 7, 3, 2, 1, 5, 1, 2, 2, -2, 2]) # Outputs: 3 # The list has 5 boomerang sequences: [1,7,1], [7,1,7], [1,7,1], [7,1,7], [1,7,1] count_boomerang_sequences([1, 7, 1, 7, 1, 7, 1]) # Outputs: 5 # The list has 1 boomerang sequence: [6,7,6] count_boomerang_sequences([5, 6, 6, 7, 6, 3, 9]) # Outputs: 1 # The list doesn't have any boomerang sequences count_boomerang_sequences([4, 4, 4, 9, 9, 9, 9]) # Outputs: 0 ```