Full Intution From Scratch(You Won't Regret) C++
Intuition\n###### <- As given in the question that nums is an array of even length,you have to split it into two parts such that they are equal in terms of leng
# Intuition\n###### <- As given in the question that nums is an array of even length,you have to split it into two parts such that they are equal in terms of length and each part length will be (original length of array/2) (ofcourse becuase original array length is even so we can split it into two equal parts of same length n/2)\n#### One thing that I know for sure that in order to divide the array in n/2 parts i have to take all the elements that are present in the original array means i cannot skip any element\n###### Now second condition is that i have to divide it in such a way that each part contains distinct or unique element that means we cant repeat the number in same part however if the number is in two different parts that is okay\n\n##### Now think when i will not be able to split ,ofcourse when the given condition will become  wrong and when will that happen ,when a part will not have distinct element means it will have two or more element of same type in the same part\n\n###### Now when this condition will happen ,when there are more than 2 elements in the original array of same type, so we forcefully need to put same type element more than once in same part that will break the condition and we will not be able to split the array\n###### So we just need to check if the freq of all the elements in original array is less than equal to 2 if yes then it is true otherwise it will be false>\nFor checking freq whats the best way :-Hashmap \n\n# Approach\n##### <Take a unordered map and save all the freq of all elements from original array then check if any element has freq greater than 2 if yes return false else return true\n\n# Complexity\n- Time complexity:\n<o(n)>\n\n- Space complexity:\n<o(n)->\n\n# Code\n```\nclass Solution {\npublic:\n    bool isPossibleToSplit(vector<int>& nums) {\n        unordered_map<int,int>k;\n        for(int i=0;i<nums.size();i++){\n            k[nums[i]]++;\n        }\n        for(int i=0;i<nums.size();i++){\n            if(k[nums[i]]>2){\n                return false;\n            }\n        }\n        return true;\n    }\n};\n\n\n```\nUPVOTE :)
['Hash Table', 'C++']