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 楼
你怎样看到的收费的题目?
相关阅读
不想再继续做工程师下去了?How long it take for H4 application?去实习要换I-20? 换成什么样的啊?请问Stanford的online master含金量高吗?这个时侯还有没找到summer intern的CS phd么?请问 怎么申请opt17个月extension周四onsite,求bless问一下办Pre-OPT大概需要多久?请推荐印名片的公司,谢谢!who has facebook recruiters' contact info? I really appreciate it!opt期间换工作的gap怎么算工作求建议刚phone interview 完, 估计没戏了。can OPT visa work for two companies?OPT问题求助!consultant company 的直接hire可靠么,对H1B这道amazon的题怎么弄?明天onsite,求blesssUK job interview请问G家的RECUTER电面是什么问题?