- Difficulty: Hard
- Each of N people has either a dog or a cat, and owns a toy for dog or for cat. Is it possible to exchange toys between acquaintances so that every animal gets an appropriate toy?
- https://app.codility.com/programmers/challenges/doge2021/
- https://app.codility.com/programmers/task/pets_and_toys/
- Result
Good
: Correctness 100%, Performance 100%.OK
: Correctness 100%, Performance <100%.Fail
: Correctness <100%, Performance <100%.
- File naming convention
- Code
A
:TheDoge2021A.java
- Code
B
:TheDoge2021B.java
- etc
- Code
Code | Complexity | Description | Result | Report |
---|---|---|---|---|
E |
O(N+M) |
Tracking Groups of A&B, and extra links | Good | ERPQ5S |
File | Complexity | Description | Result | Report |
---|---|---|---|---|
A |
O(N*M) or O(N**2+M) |
Tracking Groups of A&B | OK | SS8MKN |
B |
O(N*M) or O(N**2+M) |
Tracking Groups of A&B | OK | XJAJWW |
C |
O(N*M) or O(N**2+M) |
Tracking Groups of A&B | OK | DDCVYT |
D |
O(N*M) or O(N**2+M) |
Tracking Groups of A&B | OK | K74A3T |
File | Complexity | Description | Result | Report |
---|---|---|---|---|
F |
O(N+M) |
Java implementation of solution published by Codility. | Good | US99SP-X33 |