Infomaniak Kchat icon

Infomaniak Kchat

Interact with Infomaniak Kchat API

Actions173

Files → Get A File's Preview

AI-generated

Summary

The provided C++ code processes an integer array to compute various statistics including sum, min/max values, count of negative numbers, maximum and minimum differences between max/min for even numbers, and the mode (most frequent value). It reads N and the array elements, then outputs the computed statistics.

Inputs

  • N (required) — Number of elements in the array.
  • numbers (required) — The array of N integers.

Output shape

Map/Object

Sum, Min, Max, Negative count, Max difference, Min difference, Mode with frequency.

Examples

Example 1: Input: N=5, numbers=[1, -2, 3, 4, -5]

Sums and statistics computed and printed for the given input array.

Links

Discussion