class Solution {
public List<String> buildArray(int[] target, int n) {
List<String> ans = new ArrayList<String>();
int prev = 0;
for(int number: target)
{
for(int i = 0; i < number - prev - 1; i ++ )
{
ans.add("Push");
ans.add("Pop");
}
ans.add("Push");
prev = number;
}
return ans;
}
}