Search
⌘K

Leetcode 165. Compare Version Numbers

Compare two dotted version strings by splitting them into revisions and comparing each revision's integer value (ignoring leading zeros) left-to-right. If one version has fewer revisions, treat missing revisions as 0 and return -1/0/1 for less/equal/greater.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.