|
5 | 5 | #ifndef MEAN_RANK_COUNT_H |
6 | 6 | #define MEAN_RANK_COUNT_H |
7 | 7 |
|
8 | | -// There is a scholaship test on an education platform. |
| 8 | +// There is a scholarship test on an education platform. |
9 | 9 | // There are n students with roll numbers 1, 2, ..., n who appeared for the test, where the rank secured by |
10 | 10 | // the ith student is denoted by rank[i]. Thus, the array rank is a permutation of length n . |
11 | 11 | // Groups can only be formed with students having consecutive roll numbers, in other words, a subarray of the |
12 | 12 | // original array. For each value x (1 <= x <= n), find the number of groups that can be formed such that |
13 | 13 | // they have a mean rank equal to x. |
14 | 14 | // |
15 | | -// More formally, given a permutaion of length n, find the number of subarrays of the given array having a mean |
16 | | -// value equal to x , for each x in the range [1, n] . |
| 15 | +// More formally, given a permutation of length n, find the number of subarrays for the given array having a mean |
| 16 | +// value equal to x, for each x in the range [1, n]. |
17 | 17 | // |
18 | 18 | // Notes |
19 | 19 | // |
20 | | -// The mean value of an array of k elements is defined as the sum of elements divided by k. |
21 | | -// A permutation of leangth n is a sequence where each number from q to n appears exactly once. |
| 20 | +// The mean value of an array with k elements is defined as the sum of elements divided by k. |
| 21 | +// A permutation of length n is a sequence where each number from q to n appears exactly once. |
22 | 22 | // A subarray of an array is a contiguous section of the array. |
23 | 23 |
|
24 | 24 |
|
|
0 commit comments