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
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.