give version number version1 version2 compare themversion number consist revision join dot each revision consist digit contain lead zero every revision contain character Revisions 0indexed leave right leftmost revision revision 0 revision revision 1 for example 2533 01 valid version numbersto compare version number compare revision lefttoright order revision compare integer value ignore lead zero this mean revision 1 001 consider equal if version number specify revision index treat revision 0 for example version 10 version 11 revision 0s revision 1s 0 1 respectively 0 1return followingIf version1 version2 return 1if version1 version2 return 1Otherwise return 0 example 1input version1 101 version2 1001output 0explanation ignore lead zero 01 001 represent integer 1Example 2input version1 10 version2 100output 0explanation version1 specify revision 2 mean treat 0example 3input version1 01 version2 11output 1explanation version1s revision 0 0 version2s revision 0 1 0 1 version1 version2 constraints1 version1length version2length 500version1 version2 contain digit version1 version2 valid version numbersAll give revision version1 version2 store 32bit integer