Build an Array With Stack Operations

给一个target数组和一个数字n, 从[1..n]中用push和pop两个方法取数, 问怎么才能取到target数组中的数字.