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
48
var assert = require('assert');
function nClosestPoints(points, n) {
// add your code here
return;
}
try {
assert.deepEqual(nClosestPoints([
[1, 3],
[-2, 2]
], 1), [
[-2, 2]
]);
console.log('PASSED: ' + "`nClosestPoints([[1, 3], [-2, 2]], 1)` should return `[[-2, 2]]`");
} catch (err) {
console.log(err);
}
try {
assert.deepEqual(nClosestPoints([
[3, 3],
[5, -1],
[-2, 4]
], 2), [
[-2, 4],
OUTPUT
Results will appear here.