Google intern phone interview

原帖地址:一亩三分地

我们一个小伙伴面的暑期实习店面,两轮
第一轮就一个问题,
given a string and a query, find out the number of different ways you can match the query to the string, with wildcard “_.
For example:
for string PATTT, you can have PA__T, PAT_T, PAT__

第二轮第一题我在论坛上看到过几次。
given a list of numbers, numbers are between 1 and length of the list. find out the duplicated number.
第二题:
given a list of floats, find the closest one to a given target.

第一轮那题,小伙伴貌似没码完代码就时间到了,sigh

求米 \o/

补充内容 (2015-12-9 15:00):
第一个问题,query=”PAT”, given target string=”PATTT”。target string里的字母可以换成”_”,要求是最后剩下的是query string.
“_” is not exactly a wiledcard, but rather a mask.