deno.land / x / masx200_leetcode_test@10.6.5 / cells-in-a-range-on-an-excel-sheet / index.ts
12345678910111213141516171819202122function 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;
Version Info