My solution:
class Solution { public int missingElement(int[] nums, int k) { int i=1; for(;i<nums.length;i++){ int diff = nums[i]-nums[i-1]-1; if(diff>=k){ return nums[i-1]+k; }else{ k-=diff; } } return nums[nums.length-1]+k; } }