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
44
var assert = require('assert');
function swap(arr, first, second) {}
function dutchNatFlag(arr) {
// Fill in this method
return arr;
}
dutchNatFlag([2, 2, 2, 0, 0, 0, 1, 1]);
try {
assert.deepEqual(dutchNatFlag([2, 0, 1, 0, 2]), [0, 0, 1, 2, 2]);
console.log(
'PASSED: assert.deepEqual(dutchNatFlag([2, 0, 1, 0, 2]), [0, 0, 1, 2, 2]);'
);
} catch (err) {
console.log(err);
}
try {
assert.deepEqual(dutchNatFlag([0, 1, 2]), [0, 1, 2]);
console.log(
'PASSED: ' + 'assert.deepEqual(dutchNatFlag([0, 1, 2]), [0, 1, 2]);'
);
OUTPUT
Results will appear here.