Solution for histogram