Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
47
var assert = require('assert');
function tripletSum(nums) {
// add code here
return
}
try {
let result = tripletSum([-1, 0, 1, 2, -1, -4])
let expected = [JSON.stringify([
[-1, 0, 1],
[-1, -1, 2]
]), JSON.stringify([
[-1, -1, 2],
[-1, 0, 1]
])]
assert.equal(expected.includes(JSON.stringify(result)), true)
console.log('PASSED: ' + "`tripletSum([-1, 0, 1, 2, -1, -4])` should return `[[-1, 0, 1], [-1, -1, 2]]`");
} catch (err) {
console.log(err);
}
try {
assert.deepEqual(tripletSum([0, 1, 1]), []);
console.log('PASSED: ' + "`tripletSum([0, 1, 1])` should return `'[]`");
} catch (err) {
console.log(err);
OUTPUT
Results will appear here.