Remove Element

Total Accepted: 20787 Total Submissions: 62466 My Submissions

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.

Have you been asked this question in an interview?

Discuss


You have not signed in, cannot submit your code.
Submit failed, try again please.

Submission Result: {[{ statusText }]}

Runtime Error Message: {[{ runtimeError }]}
Last executed input: {[{ lastExecutedTestCase }]}
{[{ resultCodeOutput }]}
Input: {[{ resultWaTestCaseInput }]}
Output: {[{ resultWaTestCaseOutput }]}
Expected: {[{ resultWaTestCaseExpected }]}

Send Feedback