Domanda di colloquio di Microsoft

The interviewer asked me how I would remove a specific character from a character array.

Risposte di colloquio

Anonimo

28 gen 2019

Iterate through the array, and for every character not equal to the specific character in question append it to a dynamic data structure (I used ArrayList). Return the data structure after you finish iterating through the original character array.

Anonimo

19 feb 2019

I wonder if they wanted you to use no extra space instead.you could do by keeping track of how many of such character exist and shift the other characters to left accordingly and resize and return.