filmov
tv
Codility Dwarfs Rafting Java solution

Показать описание
Dwarfs rafting is the 2nd task in exercise 2 of Codility. The aim is to find out how many dwarfs can be transported over a river on a raft. The raft has seats and barrels and some dwarfs are seated initially on the raft. The raft must be evenly balanced with dwarfs at the front and back, and also on the left and right.
In my solution I use a 2D array to represent the raft and wrap it in a class to handle adding Barrels and Dwarfs. The Raft class is also used to calculate the answer. The solution scores 100%.
In my solution I use a 2D array to represent the raft and wrap it in a class to handle adding Barrels and Dwarfs. The Raft class is also used to calculate the answer. The solution scores 100%.
Комментарии