Delete array element in given index range [ L | Delete L to R elements ; Return size of Array after delete element ; Driver Code
function deleteElement ( A , L , R , N ) { let i , j = 0 ; for ( i = 0 ; i < N ; i ++ ) { if ( i <= L i >= R ) { A [ j ] = A [ i ] ; j ++ ; } } return j ; } let A = [ 5 , 8 , 11 , 15 , 26 , 14 , 19 , 17 , 10 , 14 ] ; let L = 2 , R = 7 ; let n = A . length ; let res_size = deleteElement ( A , L , R , n ) ; for ( let i = 0 ; i < res_size ; i ++ ) document . write ( A [ i ] + " " ) ;