```
class Solution(object):
def findMissingRanges(self, nums, lower, upper):
gen = (lambda i, j: ['%s->%s' % (i + 1, j - 1), str(i + 1)][i == j - 2])
nums = [lower - 1] + nums + [upper + 1]
return [
gen(nums[i - 1], nums[i])
for i in xrange(1, len(nums)) if nums[i] - nums[i - 1] > 1
]
```