Adobe Computer Scientist 2

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-11-27Added By Anonymous
Source: Link

First round was pure DS ALGO


Two question. 1 easy and 1 medium


1st question was

Given a stream of characters, find the first non-repeating character from the stream

val stream2 = listOf('x', 'x', 'y', 'z', 'y', 'z', 'w')

output should be - listOf('x','#','y','y','z','#','w')


Second Question

Find the longest sequence of zero's surrounded by 1

[1,0,0,1,0,0,0,1] - 3

[0,0,0,0,1] - 0

[1,0,0,0,0] - 0

[1,0,0,0,1,1,0,0,0,0,0,1]- 5

Comments