solves 10: Mth to last element
prettier solution