Simple TS Solution
Code
# Code
```typescript []
function applyOperations(nums: number[]): number[] {
    let result: number[] = [];
    let numberOfZero = 0;

    for (let i = 0; i < nums.length - 1; i++) {
        if (nums[i] === nums[i + 1]) {
            nums[i] = nums[i] * 2;
            nums[i + 1] = 0;
            if(nums[i] > 0){
                result.push(nums[i]);
            }
        } else {
            if(nums[i] > 0){
                result.push(nums[i]);
            }
        }
    }
    if(nums[nums.length - 1] > 0){
        result.push(nums[nums.length - 1]);
    } 

    numberOfZero = nums.length - result.length;

    for(let j = 0; j < numberOfZero; j++){
        result.push(0)
    }

    return result;
}

```
['TypeScript']