这个很简单,也终于实现了一次单行返回
class Solution(object): def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ return (moves.count('U')==moves.count('D')) and (moves.count('L')==moves.count('R'))
37ms 96.64%
这个很简单,也终于实现了一次单行返回
class Solution(object): def judgeCircle(self, moves): """ :type moves: str :rtype: bool """ return (moves.count('U')==moves.count('D')) and (moves.count('L')==moves.count('R'))
37ms 96.64%