题解 | #扑克牌大小#
扑克牌大小
https://www.nowcoder.com/practice/d290db02bacc4c40965ac31d16b1c3eb
nums = ['3','4','5','6','7','8','9','10', 'J','Q','K','A','2','joker','JOKER'] hashDict = {} for idx, num in enumerate(nums): hashDict[num] = idx def solution(): s = input() if "joker JOKER" in s: return "joker JOKER" s1,s2= s.split('-') l1,l2 = len(s1.split()),len(s2.split()) if (l1==4)^(l2==4): return s1 if l2!=4 else s2 if l1 != l2: return "ERROR" a = s1.split()[0] b = s2.split()[0] return s1 if hashDict[a]>hashDict[b] else s2 res = solution() print(res)
#车好多#