Medium Level Array Problems in C++
Make arr[i] = i
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Maximum Circular Subarray Sum
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Reorder according to given indexes
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Product Except Self
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
K-th Largest Sum Subarray
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Smallest missing number
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Smallest subarray with sum greater than x
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Majority Element
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Count possible triangles
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Sub-array with given sum
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Longest Subarray with Equal 0s and 1s
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Longest Common Span in Two Binary Arrays
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
Construct an array from its pair-sum array
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
2 Sum - All Pairs
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
2 Sum - Distinct Pairs
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
3 Sum - Find Any
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
3 Sum - Closest Triplet
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}
4 Sum - Find Any
#include <iostream>
using namespace std;
int main() {
cout << "Solution for problem here..." << endl;
return 0;
}