✅✅✅Simple Short C++ Explained Solution 🔥 🔥 🔥 🔥 BY MR CODER
\u2190\u2190Must Not Forget To Upvote this by clicking up side arrow\nYOU CAN WATCH THIS VIDEO FOR THE BETTER EXPLANATION\nRecommended- \nhttps://www.youtube.co
**\u2190\u2190Must Not Forget To Upvote this by clicking up side arrow**\n**YOU CAN WATCH THIS VIDEO FOR THE BETTER EXPLANATION**\n**Recommended- **\nhttps://www.youtube.com/watch?v=f0mAAQqvqR8\n\n\n\n\n\n\n\n\n\n\n\nclass Solution {\npublic:\n    #define ll long long\n    #define MOD 1000000007\n    int numFactoredBinaryTrees(vector<int>& arr) {\n        ll ans =0;\n        unordered_map<ll, ll> up;\n        sort(arr.begin(), arr.end());\n        for(int i=0; i< arr.size(); i++){\n            ll currentans=1;\n            for(int j=0; j< i; j++)\n            {\n                if(arr[i]% arr[j]) continue;\n                int ans1= arr[i]/ arr[j];\n               int ans2=  arr[j];\n                currentans= (currentans+ up[ans1]*up[ans2]%MOD)%MOD;\n                \n                \n            }\n            up[arr[i]]= currentans;\n            ans = ans+ currentans;\n            \n        }\n        return ans% MOD;\n    }\n};\n\n
[]