— I have completed already in my way boy
Also his answer isnt complete, as the initial answer wants it for ANY occurence, not just a single item.
— "boy" lol. A bit more respect may be in order.
— It's actually correctly giving the output ...But timecomplexity is high.O(n^2)
— That... i dont think that comes even close.
— It's in Worst case
— Its not remotely constant space, as you spawn a new search for each element across the entire array (stack usage is also counted, so are array elements). Nor is it O(n) nor an approximation. :P
Message permanent page
— Whats is your openion for this correct or incorrect? Tell AmAn
— What do you mean?