How do I approach this?
Write a Java code that reads the length of an integer array and its elements from the user then perform the following tasks: Write a method LargestGap() that finds the length of the largest gap in the input array. Write a method range() that finds the difference between the largest and smallest element of the array. Write a method numberOfDistinctElement() that returns the number of distinct elements in the input array. Write a method distinctElements() that returns an array with all the distinct elements in the first array. Sample run Enter the length of the array: 7 Enter the elements of the array: 1 3 5 2 5 7 3 The largest gap in the array is 4. The range of the array is 6. The number of distinct elements is 5. The array of distinct elements is [1, 3, 5, 2, 7] Note 1: You should submit one file with a .java extension. If the submitted file is not a .java file you will receive 0. Note 2: If the submitted file has any form of error (syntax, logical, runtime) error, your grade will be 0. Make sure to run your code before submitting it. Note 3: Grading is following the grading rubric used for projects. Note 4: You can read the elements of the array either all in one line or one by one.