Given an array of integers, find the closest greater element for every element. If there is no greater element then print -1 Examples: Input : arr[] = {10, 5, 11, 10, 20, 12}Output : 10 10 12 12 -1 -1 Input : arr[] = {50, 20, 200, 100, 30}Output : 100 30 -1 -1 -1 […]

## Find four factors of N with maximum product and sum equal to N | Set-2

#include <bits/stdc++.h> using namespace std; void findfactors(int n) { unordered_map<int, int> mpp; vector<int> v, v1; for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { v.push_back(i); if (i != (n / i) && i != 1) v.push_back(n / i); } } […]