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.
Count index triples whose ratings strictly increase or strictly decrease by counting smaller and larger soldiers on each side of a middle soldier.