Amazon Interview Question

implement k stacks in a given array