What's the solution? | Phone Interview | Confidential
Anonymous User
602

Hi Guys,

I had a phone interview yesterday for the Software Engineer position. Can anyone let me know how to solve this?

Given an array, we need to construct 2 arrays left and right something like this:

Ex: Array: [1,3,2]

Left           Right
[]             [1,3,2]
[1]            [3,2]
[1,3]          [2]
[1,3,2]        []
[1,2]          [3]
[3]            [1,2]
[3,2]          [1]
.
.
. 
soo on

I couldn't exactly remember the entire output but the let and right arrays have to be built that way.

Did anyone get this question in the interview before and can anyone let me know how can we solve this?

Comments (2)