Add a solution based on 'histogram'. Refactor.