6 kyu
Compare Versions
1,747 of 3,873prksingh
Description:
Karan's company makes software that provides different features based on the version of operating system of the user.
To compare versions, Karan currently parses both version numbers as floats.
While this worked for OS versions 10.6, 10.7, 10.8 and 10.9, the operating system company just released OS version 10.10. This causes his method to fail, as 10.9 is greater than 10.10 when interpreting both as numbers, despite being a lesser version.
Help Karan by writing him a function which compares two versions, and returns whether or not the first one is greater than or equal to the second.
Specification notes:
- Versions are provided as strings of one or more integers separated by
.
. - The version strings will never be empty.
- The two versions are not guaranteed to have an equal amount of sub-versions, when this happens assume that all missing sub-versions are zero.
- Two versions which differ only by trailing zero sub-versions will never be given.
Strings
Fundamentals
Similar Kata:
Stats:
Created | Jun 30, 2014 |
Published | Jun 30, 2014 |
Warriors Trained | 8051 |
Total Skips | 903 |
Total Code Submissions | 25805 |
Total Times Completed | 3873 |
JavaScript Completions | 1747 |
Ruby Completions | 222 |
Python Completions | 1623 |
Haskell Completions | 120 |
Rust Completions | 92 |
C++ Completions | 161 |
Factor Completions | 10 |
Total Stars | 125 |
% of votes with a positive feedback rating | 93% of 531 |
Total "Very Satisfied" Votes | 466 |
Total "Somewhat Satisfied" Votes | 53 |
Total "Not Satisfied" Votes | 12 |