another method that used a list of stacks to implement the requirement;not finished, because its not necessary...