add a new solution for median question