Find first non | Function to find the first non - repeating element of the given string using Linked List ; Driver Code ; Function Call
function firstNonRepElement ( str ) { let list = [ ] ; list . push ( str [ 0 ] ) ; for ( let i = 1 ; i < str . length ; i ++ ) { if ( list . includes ( str [ i ] ) ) list . splice ( list . indexOf ( str [ i ] ) , 1 ) ; else list . push ( str [ i ] ) ; } document . write ( list [ 0 ] ) ; } let str = " " ; firstNonRepElement ( str ) ;