Pergunta de entrevista da empresa Axestrack Software Solutions

Given an array, move all zeroes to the end while maintaining the relative order of non-zero elements.

Resposta da entrevista

Sigiloso

16 de dez. de 2025

I explained an optimal approach using a two-pointer technique. I iterated through the array, shifted non-zero elements forward, and then filled the remaining positions with zeroes, achieving O(n) time complexity and O(1) extra space.