Array Problems:

1. Find Second Largest Element

Problem: Given an array of integers, find the second largest element.

class ArrayProblems {
public:
    int findSecondLargest(vector<int>& arr);
};

2. Check if Array is Sorted

Problem: Check if the given array is sorted in ascending order.

class ArrayProblems {
public:
    bool isSorted(vector<int>& arr);
};

3. Count Element Frequency

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);
};

4. Rotate Array Left

Problem: Rotate array to the left by k positions.