Codility Dwarfs Rafting Java solution

preview_player
Показать описание
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%.
Рекомендации по теме
Комментарии
Автор

Hi Dave, Thank you for the great explanation! Do you happen to have these code stored in the Git repo for quick reference.

Poongodi
visit shbcf.ru