#include <cstring> #include <vector> class Solution { public: int idx=0; int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; void changeDir(){ idx=(idx+1)%4; } int used[110][110]; vector<int> printMatrix(vector<vector<int> &g...