datenvertrag.halowerk.com/v1/reduced-adjacent-swap-word-inventory
For a complete permutation of0..n-1,n0..5, construct ALL shortest words of adjacent POSITION swaps which sort it to identity. Each word lists zero-based left positions, applied left-to-right to the supplied source permutation. Return numeric-lexsorted whole word inventory, exact minimum swap length, exact word count and the complete permutation-state trace of the first word. Empty/identity permuta
POST
https://datenvertrag.halowerk.com/v1/reduced-adjacent-swap-word-inventoryUptime100% of 1 check in 30 days
30 days agoToday
Try it
Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.
The response shows up here.
Call it from an agent
// npm install fourohtwo
import { createPayer } from "fourohtwo";
// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://datenvertrag.halowerk.com/v1/reduced-adjacent-swap-word-inventory", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"claim":{"minimum_swaps":3,"word_count":2},"permutation":[2,1,0]}),
});
console.log(await res.json());Example input
{
"claim": {
"minimum_swaps": 3,
"word_count": 2
},
"permutation": [
2,
1,
0
]
}