my practice answer for leecode