dbarshan

Parse Index List

Jun 22nd, 2021
632
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. vector<vector<int>> parseIndexList(vector<string> &strIndexList){
  2.     vector<vector<int>> result;
  3.  
  4.     for ( auto s : strIndexList){
  5.         int row = stoi(s.substr(0, s.find(" ")));  
  6.         int col = stoi(s.substr(s.find(" ")+1));
  7.         result.push_back({row,col});
  8.     }
  9.     return result;
  10. }
RAW Paste Data