Move all occurrence of letter ' x ' from the string s to the end using Recursion | Function to move all ' x ' in the end ; Store current character ; Check if current character is not ' x ' ; Recursive function call ; Check if current character is ' x ' ; Driver code
function moveAtEnd ( s , i , l ) { if ( i >= l ) return ; let curr = s [ i ] ; if ( curr != ' ' ) document . write ( curr ) ; moveAtEnd ( s , i + 1 , l ) ; if ( curr == ' ' ) document . write ( curr ) ; return ; } let s = " " ; let l = s . length ; moveAtEnd ( s , 0 , l ) ;