亚马逊笔试题目_亚马逊在线笔试题目

亚马逊在线笔试题目

Question 2 / 2

Question:

As you know, two operations of Stack are push and pop. Now give you two integer arrays, one is the original array before

push and pop operations, the other one is the result array after a series of push and pop operations to the first array. Please

give the push and pop operation sequence.

For example:

If the original array is a[] = {1,2,3}, and the result array is b[] = {1,3,2}.

Then, the operation sequence is “push1|pop1|push2|push3|pop3|pop2”(operations are split by ‘|’ and no space).

Rules:

1. The push and pop operations deal with the original int array from left to right.

2. The input is two integer array. They are the original array and the result array. These interger array is split by space.

3. The output is the operation sequence.

4. If the original array cannot make to the result arra

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值