Easy-题目66:165. Compare Version Numbers

原创 2016年05月30日 22:43:24

题目原文:
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.

You may assume that the version strings are non-empty and contain only digits and the . character.
The . character does not represent a decimal point and is used to separate number sequences.
For instance, 2.5 is not “two and a half” or “half way to version three”, it is the fifth second-level revision of the second first-level revision.
题目大意:
比较两个软件的版本号version1和version2.如果version1>version2则返回1,version1

版权声明:完整版Leetcode题解请出门左转https://github.com/cmershen1/leetcode/tree/master/docs

相关文章推荐

Leetcode 165. Compare Version Numbers (Easy) (cpp)

Leetcode 165. Compare Version Numbers (Easy) (cpp)
  • Niko_Ke
  • Niko_Ke
  • 2016年07月19日 12:34
  • 163

165. Compare Version Numbers [easy] (Python)

题目链接https://leetcode.com/problems/compare-version-numbers/题目原文 Compare two version numbers version...

leetCode 165. Compare Version Numbers

这道题是要我们比较两个版本号(就是那些软件的版本号)的大小。一开始我还奇怪这道题很简单怎么通过率这么低(17.7%)。做完之后我就知道我还是太年轻了= =一开始我是直接用atof函数把string转成...

LeetCode 165. Compare Version Numbers(比较版本)

原题网址:https://leetcode.com/problems/compare-version-numbers/ Compare two version numbers version1 a...
  • jmspan
  • jmspan
  • 2016年05月25日 01:40
  • 252

[leetcode 165] Compare Version Numbers

Question: Compare two version numbers version1 and version2. If version1 > version2 return 1, ...

165. Compare Version Numbers

Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 vers...
  • x_shuck
  • x_shuck
  • 2016年03月21日 00:17
  • 167

LeetCode笔记:165. Compare Version Numbers

比较两个版本号大小

LeetCode 165: Compare Version Numbers

Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 vers...

leetcode 165 Compare Version Numbers

Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < ...

LeetCode 第 165 题(Compare Version Numbers)

LeetCode 第 165 题(Compare Version Numbers) Compare two version numbers version1 and version2. If...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Easy-题目66:165. Compare Version Numbers
举报原因:
原因补充:

(最多只允许输入30个字)