- Difficulty: Medium
- Find the maximum number of towers with same color order that can be obtained from an initial group of tricolored towers if at most one swap of adjacent colors can be performed in every tower.
- https://app.codility.com/programmers/challenges/year_of_the_tiger_2022/
- https://app.codility.com/programmers/task/tricolored_towers/
- Result
Good
: Correctness 100%, Performance 100%.OK
: Correctness 100%, Performance <100%.Fail
: Correctness <100%, Performance <100%.
- File naming convention
- Code
A
:YearOfTheTiger2022A.java
- etc
- Code
File | Complexity | Result | Report |
---|---|---|---|
A |
O(N) |
Good |
E335J3 |
File | Complexity | Result | Report |
---|---|---|---|
B1 |
O(3**N * N) or O(N**2) or O(N * A**3) |
Fail |
DV9VG9 |
B2 |
O(3**N * N) or O(N**2) or O(N * A**3) |
Fail |
U32Y62 |
B3 |
O(3**N * N) or O(N**2) or O(N * A**3) |
Fail |
QWCH5K |
B4 |
O(N * A**3) |
OK |
C5KMU2 |
B3
,B4
are same solutions, using different implementations.