Array integer mode
array-integer-mode · version 1.0.0 · Numbers & math · free, no key needed
Return the most frequent canonical integers, listing every mode in first-seen order.
Use when you need to: array integer mode · mode of integer strings · most frequent integers.
Supported
- array integer mode
- mode of integer strings
- most frequent integers
Not supported
- kernel density
- fuzzy clustering
- mean of integers
- CSV column mode
Behavior
- values is a non-empty array of at most 10000 canonical integer strings (BigInt; -0 becomes 0).
- Frequencies are counted on canonical integer values, not original spellings.
- count is the maximum frequency as a JSON integer.
- modes lists every canonical value that occurs count times, in first-seen order.
- If every value is unique, every value is a mode and count is 1.
Input
values(array of string, required): min items 1; max items 10000; each min length 1; each max length 1001
Output
modes(array of string, required): min items 1; max items 10000; each pattern^(0|-?[1-9][0-9]*)$count(integer, required): min 1; max 10000
Limits
- max values: 10000
- max digits: 1000
Example
Request input:
{
"values": [
"2",
"1",
"2",
"3",
"1",
"2"
]
}
Response:
{
"result": {
"modes": [
"2"
],
"count": 3
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "array-integer-mode",
"version": "1.0.0",
"input": {
"values": [
"2",
"1",
"2",
"3",
"1",
"2"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/array-integer-mode/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"values":["2","1","2","3","1","2"]}'
The machine-readable contract is at /v1/tools/array-integer-mode/versions/1.0.0.
CLI
node cli.mjs run array-integer-mode 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array integer cumulative sum: Replace an array of canonical integer strings with equal-length prefix sums.
- Array integer GCD: Compute the non-negative greatest common divisor of an array of canonical integer strings.
- Array integer LCM: Compute the non-negative least common multiple of an array of canonical integer strings.
- Array integer median: Select lower and upper middle canonical integers; emit median only for odd length.
- Array integer min max: Return the numeric minimum and maximum of canonical integer strings.
- Array integer product: Multiply an array of canonical integer strings and return the canonical product.