# Array Removals

Problem Link: <https://practice.geeksforgeeks.org/problems/array-removals/1>

```python
class Solution:

	def removals(self,arr, n, k):
		# code here
		arr.sort()
		j=0
		ans=0
		for i in range(n):
		    
		    while(arr[i]-arr[j]>k):
		        j+=1
	        
	        ans=max(ans,i-j+1)
	    return n-ans
```
