MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / solve

Function solve

CPP/array-2d/CycleDetection.cpp:26–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26bool solve(vector<vector<int>>& mat) {
27 vector<vector<int>> vis(mat.size(),vector<int>(mat[0].size(),0));
28 for(int i=0; i < mat.size();i++){
29 for(int j=0; j < mat[0].size();j++){
30 if(vis[i][j]==0){
31 if(helper(mat,i,j,mat[i][j],vis))return 1;
32 }
33 }
34 }
35 return 0;
36}

Callers

nothing calls this directly

Calls 2

helperFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected