If we found the triplets then print it and set the flag
if ( target == a [ start ] + a [ end ] ) { document . write ( " " + a [ i ] + " " + a [ start ] + " " + a [ end ] + " " ) ; flag = true ; start ++ ; end -- ; }