The Code Shelf
Published in

The Code Shelf

CODING

Day 3: The “Compare Version Numbers” Problem

Problem:

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.

--

--

--

Well-curated thoughts about different programming paradigms, concepts etc., written with a cup of coffee

Recommended from Medium

React’s some interview questions

FileMaker 16’s New {JSON} Functions

FileMaker 16's New {JSON} Functions

TypeScript: Varargs Overload Signatures

Files and Streams-Node.js essential knowledge 4

Upload files to Amazon’s S3 with React

Unit testing Using Reactive forms in Angular

Component Life Cycle in React Native

useEffect()

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anjana Sudhir

Anjana Sudhir

Senior Software Engineer & Scrum Master @ Agoda (Booking Holdings Inc.)

More from Medium

Getting Ready for the Role Of Software Developer :

Remove a node in Linked List without traversing it

CODE IT YOURSELF ! #01 Linked List.

Leetcode — Valid Palindrome III