Company: fastenal
Difficulty: easy
Same After Sorting You are given two arrays of integers, a and b . Sort both arrays into non-decreasing order. If the two sorted arrays are identical, the arrays are the same; otherwise they are not. Two sorted arrays are identical only when they have the same number of elements and every position holds the same value, so a and b are the same exactly when they contain the same values with the same multiplicities. For each pair of arrays you are given, report true if the arrays are the same and false if they are not. Input Format The first line contains a single integer t , the number of pairs of arrays. Each pair is described by three lines: a line with two space-separated integers n and m , the lengths of a and of b ; a line with n space-separated integers, the elements of a ; a line with m space-separated integers, the elements of b . Output Format For each pair, print true on its own line if the two arrays become identical once both are sorted, and false otherwise. Print the answers