I am very new to the Objective-C language and I was asked a question in the interview that I was not able to answer.
I tried a lot of approaches and logic to no success. Here looking for an answer:
The question was:
- (NSArray *)reorderTheArraysAndMergeThemInDescendingOrder:(NSArray *)firstArray and:(NSArray *)secondArray
Both the provided arrays in the argument are already sorted in ascending order.
My task was to provide an array as the return variable which will have all the unique elements of both firstArray and the secondArray and will have them in theh descending order. I was not allowed to use the inbuilt sorting functionality of Objective-C (that was the way I have been doing it ever since I am in this field). My variables may only be primitives (the result will be an integer array of course.).
I am new to the whole programming scene altogether and a good answer here will be MUCH appreciated.
Shukaku