GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Leetcode_python/Solutions/165_Compare_Version_Numbers.py at master · xtymichael/Leetcode_python Expand file tree/ Copy path165_Compare_Version_Numbers.pyMore file actions 10 lines (10 loc) · 376 Bytes / Copy path165_Compare_Version_Numbers.pyFile metadata and controls10 lines (10 loc) · 376 Bytes 1 2 3 4 5 6 7 8 9 10 class Solution: # @param {string} version1 # @param {string} version2 # @return {integer} def compareVersion(self, version1, version2): f1 = map(lambda x: int(x) ,version1.split('.')) f2 = map(lambda x: int(x) ,version2.split('.')) f1 += [0]*(len(f2)-len(f1)) f2 += [0]*(len(f1)-len(f2)) return 1 if f1 > f2 else (-1 if f1 < f2 else 0) |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |