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
35
var assert = require('assert');
const histArr = [3, 1, 4, 2, 2, 1];
function maxRectInHist(histArr) {
// Fill in this method
return histArr;
}
console.log(maxRectInHist(histArr));
try {
assert.equal(maxRectInHist([3, 1, 4, 2, 2, 1]), 6);
console.log('PASSED: ' + 'maxRectInHist([3, 1, 4, 2, 2, 1])');
} catch (err) {
console.log(err);
}
try {
assert.equal(maxRectInHist([]), 0);
console.log('PASSED: ' + 'maxRectInHist([])');
} catch (err) {
console.log(err);
}
OUTPUT
Results will appear here.