A cell (r, c) of an excel sheet is represented as a string "&lt;col&gt;&lt;row&gt;" where:


	&lt;col&gt; denotes the column number c of the cell. It is represented by alphabetical letters.

	
		For example, the 1st column is denoted by 'A', the 2nd by 'B', the 3rd by 'C', and so on.
	
	
	&lt;row&gt; is the row number r of the cell. The rth row is represented by the integer r.


You are given a string s&nbsp;in&nbsp;the format "&lt;col1&gt;&lt;row1&gt;:&lt;col2&gt;&lt;row2&gt;", where &lt;col1&gt; represents the column c1, &lt;row1&gt; represents the row r1, &lt;col2&gt; represents the column c2, and &lt;row2&gt; represents the row r2, such that r1 &lt;= r2 and c1 &lt;= c2.

Return the list of cells (x, y) such that r1 &lt;= x &lt;= r2 and c1 &lt;= y &lt;= c2. The cells should be represented as&nbsp;strings in the format mentioned above and be sorted in non-decreasing order first by columns and then by rows.

&nbsp;
Example 1:

Input: s = "K1:L2"
Output: ["K1","K2","L1","L2"]
Explanation:
The above diagram shows the cells which should be present in the list.
The red arrows denote the order in which the cells should be presented.


Example 2:

Input: s = "A1:F1"
Output: ["A1","B1","C1","D1","E1","F1"]
Explanation:
The above diagram shows the cells which should be present in the list.
The red arrow denotes the order in which the cells should be presented.


&nbsp;
Constraints:


	s.length == 5
	'A' &lt;= s[0] &lt;= s[3] &lt;= 'Z'
	'1' &lt;= s[1] &lt;= s[4] &lt;= '9'
	s consists of uppercase English letters, digits and ':'.


class Solution:
    def cellsInRange(self, s: str) -> List[str]:
        start, end = s.split(':')
        start_letter, start_num = start[0], int(start[-1])
        end_letter, end_num = end[0], int(end[1])
        alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
        alphabet_slice = \
            alphabet[alphabet.index(start_letter):alphabet.index(end_letter) + 1]
        res = list()
        for el in alphabet_slice:
            res += [el + str(num) for num in range(start_num, end_num + 1)]
        return res
class Solution {
    public List<String> cellsInRange(String s) {
        char sc = s.charAt(0), ec = s.charAt(3);
        char sr = s.charAt(1), er = s.charAt(4);
        List<String> res = new ArrayList<>();
        
        for (char i = sc; i <= ec; ++i){
            for (char j = sr; j <= er; ++j){
                res.add(new String(new char[]{i, j}));
            }
        }
        
        return res;
    }
}
class Solution {
public:
    vector<string> cellsInRange(string s) {

        vector<string>ans;

        for(char ch=s[0];ch<=s[3];ch++)
        {
            for(int i=s[1]-'0';i<=s[4]-'0';i++)
            {
                string res="";
                res+=ch;
                res+=to_string(i);
                ans.push_back(res);

            }
        }
        return ans;
    }
};
const toCharCode = (char) => char.charCodeAt()

var cellsInRange = function(s) {
    const result = []
    for(let i = toCharCode(s[0]) ; i <= toCharCode(s[3]) ; i++){
        for(let j = s[1] ; j <= s[4] ; j++){
            result.push(String.fromCharCode(i) +j)
        }
    }
    return result
};
Cells in a Range on an Excel Sheet