# Array integer ranks

`array-integer-ranks` · version 1.0.0 · Numbers & math · free, no key needed

Assign competition (1224) ranks to canonical integers; ties share the minimum rank.

**Use when you need to: array integer ranks · competition ranks of integers · 1224 integer ranks.**

## Supported

- array integer ranks
- competition ranks of integers
- 1224 integer ranks

## Not supported

- dense ranks
- ordinal ranks
- fractional ranks
- percentile ranks

## Behavior

- values is a non-empty array of at most 10000 canonical integer strings (BigInt; -0 becomes 0).
- Smaller numeric values rank closer to 1.
- Tied values share the minimum competition rank of the tie group; the next distinct value skips ranks (1224).
- The rank of a value equals 1 plus the number of input values that are strictly smaller.
- ranks has the same length and order as values; each rank is a JSON integer >= 1.

## Input

- `values` (array of string, required): min items 1; max items 10000; each min length 1; each max length 1001

## Output

- `ranks` (array of integer, required): min items 1; max items 10000; each min 1; each max 10000

## Limits

- max values: 10000
- max digits: 1000

## Example

Request input:

```json
{
  "values": [
    "3",
    "1",
    "1",
    "2"
  ]
}
```

Response:

```json
{
  "result": {
    "ranks": [
      4,
      1,
      1,
      3
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "array-integer-ranks",
  "version": "1.0.0",
  "input": {
    "values": [
      "3",
      "1",
      "1",
      "2"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/array-integer-ranks/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"values":["3","1","1","2"]}'
```

The machine-readable contract is at [/v1/tools/array-integer-ranks/versions/1.0.0](/v1/tools/array-integer-ranks/versions/1.0.0).

### CLI

```sh
node cli.mjs run array-integer-ranks 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Array integer GCD](/tools/array-integer-gcd): Compute the non-negative greatest common divisor of an array of canonical integer strings.
- [Array integer LCM](/tools/array-integer-lcm): Compute the non-negative least common multiple of an array of canonical integer strings.
- [Array integer min max](/tools/array-integer-min-max): Return the numeric minimum and maximum of canonical integer strings.
- [Array integer mode](/tools/array-integer-mode): Return the most frequent canonical integers, listing every mode in first-seen order.
- [Array integer adjacent diff](/tools/array-integer-adjacent-diff): Replace an array of canonical integer strings with consecutive first differences.
- [Array integer cumulative sum](/tools/array-integer-cumulative-sum): Replace an array of canonical integer strings with equal-length prefix sums.
