Simple Beginner friendly C++ Code | Beats 90 % users
Intuition\n Describe your first thoughts on how to solve this problem. \nif a number occurs 2 times we can insert each in 2 array but if it occurs more than 2 t
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nif a number occurs 2 times we can insert each in 2 array but if it occurs more than 2 times than atleast one of the splited array will have duplicate value, so we will simple count freq of each element\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n```\nclass Solution {\npublic:\n    bool isPossibleToSplit(vector<int>& nums)\n    {\n        ios_base::sync_with_stdio(false);\n        vector<int> freq(101,0);\n        \n        for(int i = 0; i < nums.size(); i++)\n        {\n            freq[nums[i]]++;\n        }\n        for(int i = 0; i < freq.size(); i++)\n        {\n            if(freq[i] >= 3)\n                return false;\n        }\n        return true;\n    }\n};\n```
['C++']