Add getFruitType function
Improve BFS efficiency and remove targetClosestCrate function