Function to find odd freq char and reducing its freq by 1 returns " " if odd freq char is not present
function findOddAndRemoveItsFreq ( $ freq ) { global $ MAX_CHAR ; $ odd_str = " " ; for ( $ i = 0 ; $ i < $ MAX_CHAR ; $ i ++ ) { if ( $ freq [ $ i ] % 2 != 0 ) { $ freq [ $ i ] -- ; $ odd_str . = chr ( $ i + ord ( ' a ' ) ) ; return $ odd_str ; } } return $ odd_str ; }