you give phone number string number number consist digits space andor dash you like reformat phone number certain manner Firstly remove space dash then group digit leave right block length 3 4 few digit the final digit group follows2 digit a single block length 23 digit a single block length 34 digits two block length 2 eachthe block join dash Notice reformatte process produce block length 1 produce block length 2return phone number format Example 1input number 12345 6output 123456explanation the digit 123456step 1 there 4 digit group 3 digits the 1st block 123step 2 there 3 digit remain single block length 3 the 2nd block 456joining block give 123456example 2input number 123 4567output 1234567explanation the digit 1234567step 1 there 4 digit group 3 digits the 1st block 123step 2 there 4 digit leave split block length 2 the block 45 67joining block give 1234567example 3input number 123 45678output 12345678explanation the digit 12345678step 1 the 1st block 123step 2 the 2nd block 456step 3 there 2 digit leave single block length 2 the 3rd block 78joining block give 12345678 Constraints2 numberlength 100number consist digit character there digit number