6) We аre given аn unsоrted аrray A with n numbers between 1 and M, where M is a large but cоnstant pоsition integer. We want to find i f there exist two elements of the array that are within T of one another. 1. Design a simple algorithm that solves this in O(n^2). 2. Design a simple algorithm that solves this in O(n log n). 3. How could you solve this in O(n)?