Problem 1395 · Medium

Count Number of Teams

Count index triples whose ratings strictly increase or strictly decrease by counting smaller and larger soldiers on each side of a middle soldier.

Open the interactive visualisation