Small refactor of maximum value given difficulty