deno.land / x / masx200_leetcode_test@10.6.5 / cells-in-a-range-on-an-excel-sheet / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function cellsInRange(s: string): string[] { const [col1, row1, , col2, row2] = s; const res: string[] = [];
for ( let col = col1; col <= col2; col = String.fromCharCode(col.charCodeAt(0) + 1) ) { for ( let row = row1; row <= row2; row = String.fromCharCode(row.charCodeAt(0) + 1) ) { res.push(col + row); } }
return res;}export default cellsInRange;
masx200_leetcode_test

Version Info

Tagged at
a year ago