Pick peaks
The output will be returned as an object with two properties: pos and peaks. Both of these properties should be arrays. If there is no peak in the given array, then the output should be `{pos: [], peaks: []}`.The output will be returned as an associative array with two key-value pairs: `'pos'` and `'peaks'`. Both of them should be (non-associative) arrays. If there is no peak in the given array, simply return `['pos' => [], 'peaks' => []]`.The output will be returned as an object of type `PeakData` which has two members: `pos` and `peaks`. Both of these members should be `vector<int>`s. If there is no peak in the given array then the output should be a `PeakData` with an empty vector for both the `pos` and `peaks` members.
`PeakData` is defined in Preloaded as follows:
```cpp
struct PeakData {
vector<int> pos, peaks;
};
```The output will be returned as a ``Map<String,List<integer>>` with two key-value pairs: `"pos"` and `"peaks"`. If there is no peak in the given array, simply return `{"pos" => [], "peaks" => []}`.The output will be returned as a `Dictionary<string, List<int>>` with two key-value pairs: `"pos"` and `"peaks"`.
If there is no peak in the given array, simply return `{"pos" => new List<int>(), "peaks" => new List<int>()}`.Solutions
π Python
Last updated