I have 3 problems, which are more or less similar.
Given a integer array, I want to find the longest continuous subarray, such that the subarray is in increasing order of numbers.
Given a integer array, I want to find the longest continuous subarray, such that the subarray have all same numbers.
Given a character array, I want to find the longest continuous subarray, such that the subarray have all same characters.
I want to fully exploit concepts of reusability and extensibility in oops. I have implemented some code using templates. I have gave it a try and made a class template for problem 2 and 3 since they both can be done just comparing the ascii value of number or character. But I am not sure how to integrate the code for problem 1? I just want to know how tackle such problems from the perspective of reusability and extensibility using inheritance.