I thought this would be fast enough, but if k is a large number like 10000, it still needs to compare pretty much everything in the dictionary. Is there a way to speed this up?

```
public bool ContainsNearbyAlmostDuplicate(int[] nums, int k, int t)
{
Dictionary<int, long> dic = new Dictionary<int, long>();
// Key = place in nums[], Value = actualy integer
for (int i = 0; i < nums.Count(); i++)
{
if (i > k)
dic.Remove(i - k - 1);
if (dic.Any(x => Math.Abs(x.Value - nums[i]) <= t))
return true;
dic.Add(i, nums[i]);
}
return false;
}
```