employer cover photo
employer logo
employer logo

Sketch Brahma Technologies

Ist dies Ihr Unternehmen?

Frage im Vorstellungsgespräch bei Sketch Brahma Technologies

Move k elements in Array.

Antwort im Vorstellungsgespräch

Anonym

13. Juli 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.