【文件属性】:
文件名称:mn铺瓷砖leetcode-leetcode:leetcode
文件大小:389KB
文件格式:ZIP
更新时间:2021-06-30 12:42:53
系统开源
mn铺瓷砖leetcode
典型题型
Min-Max
A,B
轮流选择一个队尾和队首的元素,当队列为空时,判断A,B谁拿取的总数最大
给定一个数组,Alex
每次从数组的最左边或者最右边挑选一个,Lee
也是同样的操作,每次每人的选择都是最优的
求最后的输赢关系
Example
1:
Input:
[5,3,4,5]
Output:
true
Explanation:
Alex
starts
first,
and
can
only
take
the
first
5
or
the
last
5.
Say
he
takes
the
first
5,
so
that
the
row
becomes
[3,
4,
5].
If
Lee
takes
3,
then
the
board
is
[4,
5],
and
Alex
takes
5
to
win
with
10
points.
If
Lee
takes
the
last
5,
then
the
board
is
[3,
4],
and
Alex
takes
4
to
win
with
9
points.
This
demonstrated