Problem: Given an array of integers, find the second largest element.
class ArrayProblems {
public:
int findSecondLargest(vector<int>& arr);
};
Problem: Check if the given array is sorted in ascending order.
class ArrayProblems {
public:
bool isSorted(vector<int>& arr);
};
Problem: Count the frequency of each element in an array and return as a map.
class ArrayProblems {
public:
map<int, int> countFrequency(vector<int>& arr);
};
Problem: Rotate array to the left by k positions.