C # implementation of the approach
using System ; using System . Collections . Generic ; using System . Text ; class GFG { static void reverse ( char [ ] A , int l , int h ) { if ( l < h ) { char ch = A [ l ] ; A [ l ] = A [ h ] ; A [ h ] = ch ; reverse ( A , l + 1 , h - 1 ) ; } }