版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、亚马逊2013校招笔试题 Give n an array with positive in tegers and ano ther in teger for example7 2 4 9, you are required to gen erate an equati on, by insertingoperator add ( + ) and minus ( - ) among the array . The left side of equati on are con sist of the array and the right side of equati on is the in t
2、eger. here the result is 7-2+4=9 Rules: Don t in clude any space in the gen erated equati on. In case there is no way to create the equation, please output Inv alid . For example 1 1 10, output is In valid The len gth of the in teger array is from 1 to 15( in clude 1 and 15). If the len gth is 1, fo
3、r example the in put 7 7, the output is 7=7 There is no operator + or - in front of the first nu mber: Don t cha nge the order of the nu mbers. For example: 7 2 4 9. 7-2+4=9 is correct an swer, 4-2+7=9 is wrong an swer. There could be multiple in put, meaning your fun cti on could be called multiple
4、 times. Do remember print a new line after the call. Sample In put and Output: In put: 1 2 3 4 10 2 1 2 3 4 5 Output: 1+2+3+4=10 In valid Question 2 / 2 are Questi on: There is a 5*5 matrix; the elements in this matrix differe nt in teger from 0 to 24. The eleme nts in this matrix are 3 24, 15, 11,
5、12, 9 5 be disordered. 0 is a special eleme nt. The upper eleme nt, un der element, left element and right element of 0 can excha nged with 0. Such excha nge operatio ns are n amed as U , D , L and R . Operati on U means 0 excha nged with its upper eleme nt. Operati on D means 0 excha nged with its
6、un der eleme nt. Operati on L means 0 excha nged with its left eleme nt. Operati on R means 0 excha nged with its right eleme nt. For example, the origi nal matrix is 24, 4, 15, 11,9 13, 0, 22, 12, 14 23, 16, 1,2, 5 21, 17, 8, 3, 6 With the operati on seque nee URRDDL , the new matrix will be 20, 18
7、, 7, 19, 10 13, 4, 22, 2, 14 23, 16, 0, 1, 5 21, 17, 8, 3, 6 Now, we know the original matrix, the matrix after the operati ons and all the operati ons made on the orig inal matrix. Please provide the correct seque nee for the operati ons. The in put will be the orig inal matrix, the target matrix a
8、nd an operati on seque nee with wrong order. If there is a correct sequenee for this in put, then print the correct seque nee. Otherwise, print None . Rules and example: The eleme nts in the origi nal matrix are differe nt. The eleme nts in the origi nal matrix are ran dom ordered. The max len ght o
9、f operato ins is 15. If 0 is already on the boun dary, it is not possible to do further movement.for example, if 0 is in the top row, then there is no more U . The in put will be the orig inal matrix, the target matrix and an operati on seque nee with wrong order. The output will be a correct operati on seque nee. In ease there is no way to get the target matrix with
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- (正式版)JTT 1218.6-2024 城市轨道交通运营设备维修与更新技术规范 第6部分:站台门
- 永辉物流预算表
- 飞机镍丝行业总体规模
- 建材监理分公司合作协议书
- 2024年地理信息大数据项目资金需求报告代可行性研究报告
- 福建省福州市杨桥中学高一数学文下学期期末试卷含解析
- 江西省九江市海形中学高一数学文上学期摸底试题含解析
- 幼儿园大班科学教案11篇
- 云南省昆明市西山区第二中学高一英语知识点试题含解析
- 湖南省邵阳市体育中学高一数学文模拟试题含解析
- 小学体育室内课件-篮球
- 2023年陕西省宝鸡市渭滨区小升初英语试卷
- 中国建筑垃圾再生利用行业市场现状分析及竞争格局与投资发展研究报告2024-2029版
- 阿里巴巴国际站店铺运营策略研究
- 少先队工作指导手册
- 浙江省萧山区萧山中学2021-2022学年高一上学期自主招生入学模拟英语考试
- 年产10万吨乙腈法生产丁二烯的工艺设计
- 胖东来营销模式优化
- 《城市轨道交通安全门系统运行与维护》课程标准
- 人教版中考模拟考试化学试卷和答案解析(共四套)
- 医院财务科培训计划
评论
0/150
提交评论