kk
BAN USER
Questions (2)
Reputation 20
- 0of 0 votes
AnswersIn a given string of 0s and 1s , if you flip only one 0 to 1 , what would be the longest contiguous string of 1s possible. e.g
- kk in India
{0 01 0 11010 0} the answer would be 4 and attained by flipping bit number 7 form 0 to 1 . Came up with O(n2) , expected was O(n)| Report Duplicate | Flag | PURGE
Algorithm - 0of 0 votes
AnswersGiven an input string , "this is apple ****" replace all occurences of "apple" with another word say "freedom" .The interviewer insisted on returning the modified string as an array. No input parameter for writing the output provided.Dont know how can an array be returned in c or cpp . Returning the pointer to a local array would definitely not work .
- kk in India
Please comment.| Report Duplicate | Flag | PURGE
Software Engineer / Developer C++
Page:
1
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.