注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
总共八道题,前两道coding,五道选择题,一道sql
第一道coding:
A coding competition is being organized on the HackerRank platform. The participants need to be grouped into teams where each team has exactly two candidates. There are n candidates, where each candidate has a skill denoted by skillfi]. A total of (n/2) teams are to be formed, such that the total skill of each team is the same. The efficiency of a team is defined as the product of the skill levels of its two members, i.e., for the skills [1, 31, the efficiency of the team is 1 * 3 = 3. Find the sum of efficiencies of all teams thatthe minimum operations needed to convert all characters to 0
Constraints
• 2 ≤ / binaryStr/ ≤ 105
• It is guaranteed binaryStr consists of characters 0 and 1 only.
第一题感觉很简单,但没过全部的test case,看不到input,看output看出是溢出了,但返回的结果和函数定义都是long的,没大理解哪的问题。
第二题OA的时候没思路,光想着是不是位操作的啥奇技淫巧了,虽然当时也注意到00/01/10/11转换成00的最少次数,但一直没转到dp上,最后没做出来。结束后和同学交流才想起来该用dp....
后面的选择和sql很简单,这次OA估计是凉凉了... |