AlgoDaily Solution
1Locked, only available for premium members.
Community Solutions
Community solutions are only available for premium users.
Access all course materials today
The rest of this tutorial's contents are only available for premium members. Please explore your options at the link below.
xxxxxxxxxx
45
var assert = require('assert');
class MostConnectedOnes {
constructor(matrix) {
// implement this method
}
// main interface
max() {
// implement this method
}
}
try {
const matrix = [
[1, 1, 0, 0],
[0, 0, 1, 0],
[0, 1, 1, 0],
[1, 0, 0, 0],
];
const mco = new MostConnectedOnes(matrix);
assert.equal(mco.max(), 3);
console.log('PASSED: ' + 'Test 1');
} catch (err) {
console.log(err);
OUTPUT
Results will appear here.