Three Sum of an Integer Array¶
Given an integer value , find a combination of , , and such that . , , and are values in an integer array of no duplicated value.
The time complexity can’t be worse than .
You can start with the array:
1 2 3 4 5 | const size_t nint = 100;
int intarr[nint] = {591, 146, 886, 335, 554, 331, 702, 828, 128, 64,
497, 797, 831, 775, 23, 581, 870, 182, 526, 181, 918, 6, 811, 349, 913,
817, 995, 583, 993, 992, 999, 343, 779, 614, 380, 2, 260, 577, 487, 129,
268, 106, 869, 120, 271, 57, 783, 471, 477, 647};
|
See Answer.