Skip to content

Commit

Permalink
Merge pull request #39 from witek-formanski/piggybanks_fix
Browse files Browse the repository at this point in the history
fix piggybanks_dfs
  • Loading branch information
MrD4rkne authored Dec 30, 2023
2 parents e0102c9 + 1b19955 commit 849f491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cw9/zad1/piggybanks_dfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int piggybanks_dfs(std::vector<int> 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++;
}
}

Expand Down

0 comments on commit 849f491

Please sign in to comment.