j*8
2 楼
下面这个是最新的题,还是收费的。愣是没看明白考点是啥
You are playing the following Flip Game with your friend: Given a string
that contains only these two characters: + and -, you and your friend take
turns to flip two consecutive "++" into "--". The game ends when a person
can no longer make a move and therefore the other person will be the winner.
Write a function to compute all possible states of the string after one
valid move.
For example, given s = "++++", after one move, it may become one of the
following states:
[
"--++",
"+--+",
"++--"
]
If there is no valid move, return an empty list [].
You are playing the following Flip Game with your friend: Given a string
that contains only these two characters: + and -, you and your friend take
turns to flip two consecutive "++" into "--". The game ends when a person
can no longer make a move and therefore the other person will be the winner.
Write a function to compute all possible states of the string after one
valid move.
For example, given s = "++++", after one move, it may become one of the
following states:
[
"--++",
"+--+",
"++--"
]
If there is no valid move, return an empty list [].
y*i
3 楼
lc居然连这题也收录了,还真别小看这题,有follow up的,不简单
winner.
【在 j*****8 的大作中提到】
: 下面这个是最新的题,还是收费的。愣是没看明白考点是啥
: You are playing the following Flip Game with your friend: Given a string
: that contains only these two characters: + and -, you and your friend take
: turns to flip two consecutive "++" into "--". The game ends when a person
: can no longer make a move and therefore the other person will be the winner.
: Write a function to compute all possible states of the string after one
: valid move.
: For example, given s = "++++", after one move, it may become one of the
: following states:
: [
winner.
【在 j*****8 的大作中提到】
: 下面这个是最新的题,还是收费的。愣是没看明白考点是啥
: You are playing the following Flip Game with your friend: Given a string
: that contains only these two characters: + and -, you and your friend take
: turns to flip two consecutive "++" into "--". The game ends when a person
: can no longer make a move and therefore the other person will be the winner.
: Write a function to compute all possible states of the string after one
: valid move.
: For example, given s = "++++", after one move, it may become one of the
: following states:
: [
b*5
6 楼
我3,4年前, 开始刷题, 就看见过这种题目了。。。
b*e
7 楼
是。这题以前有人贴过。正解是用game theory里的Sprague Grundy Theorem。
https://en.wikipedia.org/wiki/Sprague%E2%80%93Grundy_theorem
这种题作为面试题没有任何意义。
【在 L*****e 的大作中提到】
: follow up是不是如何才能赢的算法?
https://en.wikipedia.org/wiki/Sprague%E2%80%93Grundy_theorem
这种题作为面试题没有任何意义。
【在 L*****e 的大作中提到】
: follow up是不是如何才能赢的算法?
h*p
8 楼
可惜就是狗家面经,考过好几次了
i*h
9 楼
题是越来越多了,停了一段时间不刷感觉跟不上节奏了
j*r
11 楼
见过,超难,碰见了基本上可以直接问候面试官老母,反正他就没准备让你过的
j*3
14 楼
你怎样看到的收费的题目?
相关阅读
求比较两个渣offerH1B grace period 过了一个月找到工作提交transfer来得及吗问一下FB面试照相的问题fbi的调查出来了没有?长期提供 Facebook 内推,保证回复为啥总有人觉得面试就是被黑啊吐个槽,考虑比较公司不能太参考本版只有包裹差不多几个 offer 怎么要求加钱?Google的Team Match + Uber Offer比较俺遇到国女面试官,基本都能过放水是情谊,不放水是正常现在经济不错,为什么老中IT找工作还是很难?问一下微软62的PM的包裹 (转载)一个loop里放两个operation,和两个Loop里各放一个operationCS选组选Offer 求助Facebook T4 or Google T4?想要爆料苹果硬件测试部门的一个abc经理求大华府地区硬件,embedded内推发个亚麻包裹ZJ绝对不是什么好鸟!