diff --git a/src/cw9/zad1/piggybanks_dfs.cpp b/src/cw9/zad1/piggybanks_dfs.cpp index 0bfe0f4..bd74f53 100644 --- a/src/cw9/zad1/piggybanks_dfs.cpp +++ b/src/cw9/zad1/piggybanks_dfs.cpp @@ -22,7 +22,7 @@ int piggybanks_dfs(std::vector piggybanks) { cycles[next_pig] = i; next_pig = piggybanks[next_pig]; } - if (next_pig == i) closed_cycles_count++; + if (cycles[next_pig] == i) closed_cycles_count++; } }