Geeksforgeeks

Error

×

Leaderboard

Showing:

Handle | Score |
---|---|

@Ibrahim Nash | 5725 |

@blackshadows | 5685 |

@akhayrutdinov | 5111 |

@mb1973 | 4989 |

@Quandray | 4908 |

@saiujwal13083 | 4156 |

@sanjay05 | 3762 |

@marius_valentin_dragoi | 3511 |

@sushant_a | 3453 |

@KshamaGupta | 3318 |

@the_coder95 | 3302 |

Complete Leaderboard | |

Handle | Score |

@shashi1iitk | 398 |

@Suniti Jain | 114 |

@ankish2000nayak | 104 |

@gopalsethlnct | 94 |

@senthil1185 | 90 |

@esmadhan | 90 |

@gyanadipta07 | 89 |

@satwikdash2000 | 85 |

@varunmishra3040 | 83 |

@gamec1634 | 82 |

@pj_1721 | 80 |

Complete Leaderboard |

Given two arrays **A** and **B **of positive integers. Your task is to find numbers which are present in the first array, but not present in the second array.

**Input:**

The first line of input contains an integer **T** denoting the number of test cases. Each test case contains space separated integers N and M which denotes the number of elements in the array A and B. Next two line contains space separated array elements.

**Output:**

Print space separated numbers present in the first array but not in the second.

**Constraints:**

1 <= T <= 100

1 <= N, M <= 10^{7}

1 <= A_{i},B_{i} <= 10^{18}

**Example:
Input:**

2

6 5

1 2 3 4 5 10

2 3 1 0 5

5 5

4 3 5 9 11

4 9 3 11 10

4 10

5

**Explanation:**

**Testcase 1:** 4 and 10 are present in first array while not in second array.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes
In First But Second

...

Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.