Count Good Triplets In An Array