decode ways non-recursive