employer cover photo
employer logo
employer logo

Sketch Brahma Technologies

Est-ce votre entreprise ?

Question d’entretien chez Sketch Brahma Technologies

Move k elements in Array.

Réponse à la question d'entretien

Utilisateur anonyme

13 juill. 2024

I can solve this in O(n) with extra space but O(n) without extra space is the ideal way. Answer - First reverse the array. Then reverse 0th to kth element. Then reverse from kth element to nth elemt.