Bilibili interview question

Find the missing number in an array and some variations