把字符串转换为整型列表然后逐一比较,简单易懂 class Solution: def compare(self , version1: str, version2: str) -> int: # write code here # 把字符串转换为整型数组 version1 = list(map(int, version1.split('.'))) version2 = list(map(int, version2.split('.'))) flag = 1 # 把短的版本号设置为ver...