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 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: 下面这个是最新的题,还是收费的。愣是没看明白考点是啥
: 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 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: 下面这个是最新的题,还是收费的。愣是没看明白考点是啥
: 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 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: follow up是不是如何才能赢的算法?
https://en.wikipedia.org/wiki/Sprague%E2%80%93Grundy_theorem
这种题作为面试题没有任何意义。
【在 L*****e 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: follow up是不是如何才能赢的算法?
h*p
8 楼
可惜就是狗家面经,考过好几次了
i*h
9 楼
题是越来越多了,停了一段时间不刷感觉跟不上节奏了
j*r
11 楼
见过,超难,碰见了基本上可以直接问候面试官老母,反正他就没准备让你过的
j*3
14 楼
你怎样看到的收费的题目?
相关阅读
Apple内推######## 求 entry level embedded linux 工作 #############################关于reference check (转载)急问一个关于H1B transfer的问题Capital One Onsite 求助今天真郁闷这两个怎么选有没有在square和linkedin的,求个内推女生面试,两厘米的鞋跟是不是太矮了?求助 --要求on site了,请推荐一款女士用的公文包紧急: 急求可以挂H1B身份的地方, 多谢!!H1B transfer之后啥时间可以去新公司上班这拒信看着真上火求facebook,Twitter和LinkedIn的SDE内推有在yammer做developer的么? (转载)中国职业联盟系列讲座1:北美职场第一步明天onsite,求个blessJPMorgan Chase有黑名单吗?groupon这个公司怎么样啊,怎么好多员工都是amazon跳进去的??现在front office的quant analyst一般能有多少奖金? (转载)