You are given an array of integers nums and an array of indices query. For each index in query, consider the suffix of nums that starts at that index and continues to the end of the array, and determine how many times the largest value in that suffix occurs. Return an array of these counts, in the same order as query.
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected