注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
来po个99.999%的跪经
中国小姐姐,语速不快,明显中国口音,上来电话听不清,信号差到不能忍,然后我们俩就都忍着说了十分钟的自我介绍和简历。
我blabla说半天感觉对面不一定能听见,但是还在自我陶醉地说着。
anyway 小姐姐喜欢说 “cool”,虽然我觉得我很不酷还被这个电话杂音折磨到死。
最后她说这个电话信号太差了,就拿google打过来,我撂了电话平复了一下。
接起来电话开始问技术题。。。
题目是和美女室友讨论过写了一半的题(当时觉得high level都懂了怎么可能有问题呢= =)
如下
You’replaying your favorite role-playing game, and your character has just found aroom full of treasure. You have n inventory slots. Luckily, objects of the sametype stack together, with the maximum size of the stack depending on the type(e.g. coins might stack to 10, diamonds to 5, armor to 1, etc.). Each stack (orpartial stack) takes up 1 inventory slot. Each item has a selling value (e.g. asingle diamond might be worth 10, so a stack of 5 diamonds would be worth 50).You want to maximize the total selling value of the items in your inventory.
Write afunction to find the set of things to bring home that maximizes the totalvalue.
我自己还傻了吧唧定义了个类叫item 特地定义了几个field
font face="Calibri">然后我就不知不觉地发现自己map操作和pq操作的api语法上记得不很清楚,就一直硬写。。。
最后,主要部分写完了,也过去了很久了,小姐姐还是说“cool”虽然我觉得我更💩了,但是我还是谈笑风生地问了她点问题结束了谈话。 run 都没run 最后就这样了 怪自己没好好练熟,当然题目太长了,虽然以前听过但是还是要看一会才能熟悉imput 的格式! 希望各位好运!
|