diff --git a/1460. Make Two Arrays Equal by Reversing Subarrays b/1460. Make Two Arrays Equal by Reversing Subarrays new file mode 100644 index 0000000..261a851 --- /dev/null +++ b/1460. Make Two Arrays Equal by Reversing Subarrays @@ -0,0 +1,13 @@ +class Solution { +public: + bool canBeEqual(vector& target, vector& arr) { + unordered_maphash_target; + unordered_maphash_arr; + int N = target.size(); + for (int i=0; i < N; i++) { + hash_target[target[i]]++; + hash_arr[arr[i]]++; + } + return hash_target == hash_arr; + } +};