Write a method to find all pairs in an array that sum up to a given value.
MediumProblem Statement
Write a method to find all pairs in an array that sum up to a given value.
Sample Input
Array: [1, 2, 3, 4, 5], Sum: 6
Sample Output
[[2, 4], [1, 5]]
Limits
Time: 2s · Memory: 256 MB