leetcode:LCR 169. 招式拆解 II(python3解法)
难度:简单
某套连招动作记作仅由小写字母组成的序列
arr
,其中arr[i]
第i
个招式的名字。请返回第一个只出现一次的招式名称,如不存在请返回空格。示例 1:
输入:arr = "abbccdeff" 输出:'a'示例 2:
输入:arr = "ccdd" 输出:' '限制:
0 <= arr.length <= 50000
题解:
class Solution: def dismantlingAction(self, arr: str) -> str: count_arr = [] for i in arr: if arr.count(i) == 1: return i return " "