Sunday, August 17, 2014

Remove Element

Problem

Given an array and a value, remove all instances of that value in place and return the new length.

The order of elements can be changed. It doesn't matter what you leave beyond the new length

Ideas

The problem is a little difficult to understand (my poor English - -!). if A[]={1,2,2,3} elem:2, you should return 2 and A[] = {1,3}.

Solution


No comments:

Post a Comment