Amazon interview question

implement k stacks in a given array