SAP | interview question

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2021-09-03Added By Anonymous
Source: Link
Company: SAP
Role: unknown
Interview Stage: unknown
Location: unknown
Year: unknown

Original Post:
Given 2 arrays arr1, arr2. Merge both the arrays in such a way that all the repeating elements occur consecutively. Ex: arr1[ ] = {1, 5,10, 5, 15, 4} arr2[ ] = {4, 6, 35, 8, 2, 19, 2, 5, 0, 15} O/P: res = {1, 5, 5, 5, 10, 15, 15, 4, 4, 6, 35, 8, 2, 2, 19, 0 } Can somone help me with the logic and code for this in c++?
Comments