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
21
var assert = require('assert');
function findElementInMatrix(matrix, x) {
// Your Code Here
}
try {
let matrix = [
[9, 10, 6, 7, 8],
[14, 15, 11, 12, 13],
[19, 20, 16, 17, 18],
[4, 5, 1, 2, 3],
];
let result = findElementInMatrix(matrix, 17);
assert(result.length === 2, 'Return type must be of length 2');
assert(result[0] === 2, 'Wrong Answer');
assert(result[1] === 3, 'Wrong Answer');
console.log(
'PASSED: The below matrix should result in `(2,3)`.
OUTPUT
Results will appear here.