Cells in a Range on an Excel Sheet LeetCode solution in JavaScript

1
const toCharCode = (char) => char.charCodeAt();
2

3
var cellsInRange = function (s) {
4
const result = [];
5
for (let i = toCharCode(s[0]); i <= toCharCode(s[3]); i++) {
6
for (let j = s[1]; j <= s[4]; j++) {
7
result.push(String.fromCharCode(i) + j);
8
}
9
}
10
return result;
11
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0