Battleships: refactored hit_count method