Python Solution (Beats 99.50%) || 41ms|| O(N) || Easy Solution
Complexity\n- Time complexity:\n    O(N)\n# Code\n\nclass Solution:\n    def applyOperations(self, nums: List[int]) -> List[int]:\n        zeros=0\n        i=0\
# Complexity\n- Time complexity:\n    O(N)\n# Code\n```\nclass Solution:\n    def applyOperations(self, nums: List[int]) -> List[int]:\n        zeros=0\n        i=0\n        while(i<(len(nums)-1)):\n            if(nums[i]==nums[i+1]):\n                nums[i]*=2\n                nums[i+1]=0\n                i+=1\n            i+=1\n            # print(nums)\n        zeros=nums.count(0)\n        nums = [i for i in nums if i != 0]\n        return nums+([0]*zeros)\n```
['Python3']