Showing:
Handle Score
@Ibrahim Nash 6564
@mb1973 5785
@Quandray 5275
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4639
@sanjay05 3762
@mantu_singh 3712
@gfgaccount 3627
@marius_valentin_dragoi 3525
Easy Accuracy: 77.0% Submissions: 331 Points: 2

Given n, m and the indexes (1 for first task, 2 for second task and so on..) of completed tasks, find the tasks which Tanya and Manya have to complete.

Example 1:

Input:
n = 15, m = 6
arr[] = {2, 5, 6, 7, 9, 4}
Output:
1 8 11 13 15
3 10 12 14
Explanation: The remaining tasks are :
{1, 3, 8, 10, 11, 12, 13, 14, 15}.
So Tanya should take these tasks :
{1, 8, 11, 13, 15}.
And Manya should take these tasks :
{3, 10, 12, 14}.

Example 2:

Input:
n = 4, m = 3
arr[] = {2, 4, 3}
Output:
1

Explanation: There are no task for Manya.


You don't need to read input or print anything. Your task is to complete the function findTasks() which takes the array of integers arr, m and as parameters and returns a pair of an array of integers denoting the answer.

Expected Time Complexity: O(n)
Expected Auxiliary Space: O(n)

Constraints:
1 ≤ m ≤ n ≤ 105
1 ≤ arr[i] ≤ n