if string violates tidy property , then decrease the value stored at that index by 1 and replace all the value stored right to that index by 9
( char ) str [ i ] -- ; for ( int j = i + 1 ; j < len ; j ++ ) str [ j ] = '9' ; } } return str ; }