2194. Cells in a Range on an Excel Sheet 發表於 2023-02-13 | 分類於 leetcode problemsolution123456789101112131415161718class Solution {public: vector<string> cellsInRange(string s) { char a = s[0]+1, b = s[3]; vector<string> ret; for(char c = s[0] ;c<=s[3] ; ++c){ for(int i=int(s[1]);i<=int(s[4]) ; ++i){ string temp ; temp+=c; temp+= char(i); ret.push_back(temp); } } return ret; }}; analysis time complexity O(nm) space complexity O(1)