Your task is to find the number of triples in an array that add to 1000
Explanation
Input is denoted by:
X: an array of integers
Input: x = [-200, 450, 750, 200, 400]
Output: 1
Explanation: -200 + 450 + 750 = 1000 which is the only triple that adds to 1000
Input: x = [5, 12, 18, 25, 33, 41, 47, 52, 60, 64, 75, 82, 95, 101, 118, 125, 132, 147, 165, 175, 188, 205, 215, 225, 240, 255, 265, 275, 288, 305, 315, 325, 340, 355, 365, 388, 415, 438, 465, 488, 515, 525, 540, 565, 575, 588, 615, 625, 640, 665, 675, 688, 715, 725, 740, 765, 775, 788, 815, 825, 840, 865, 875, 888]
Input: x = [4, 9, 13, 17, 22, 27, 31, 36, 44, 48, 53, 57, 61, 66, 72, 79, 83, 88, 94, 99, 104, 109, 113, 118, 123, 129, 134, 139, 145, 149, 154, 159, 163, 168, 173, 179, 184, 189, 193, 198, 204, 209, 214, 219, 223, 228, 233, 239, 244, 249, 254, 259, 263, 268, 273, 279, 284, 289, 294, 299, 304, 309, 314, 319, 324, 329, 334, 339, 344, 349, 354, 359, 364, 369, 374, 379, 384, 389, 394, 399, 404, 409, 414, 419, 424, 429, 434, 439, 444, 449, 454, 459, 464, 469, 474, 479, 484, 489, 495, 845]
Submit Here