Easiest solution , Very simple to understand for beginners also
Intuition1.Initialization:
l is an empty list to store intermediate results.
ans is an empty list for the final answer.
x is a counter for the number of zeros e
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
**1.Initialization:**
- l is an empty list to store intermediate results.
- *ans* is an empty list for the final answer.
- x is a counter for the number of zeros encountered.

**2.Doubling and Zeroing:**

- The for loop goes through the list nums from the beginning to the second last element.

- If nums[i] is equal to nums[i+1], it doubles the value of nums[i] and sets nums[i+1] to zero, then appends nums[i] to list l.

- If nums[i] and nums[i+1] are not equal, nums[i] is directly appended to l.

- The last element of nums is appended to l.

**3.Handling Zeros:**
- The next for loop iterates through the list l.

- Non-zero elements are appended to *ans*, while zero elements increment the counter x.

**4.Appending Zeros:**

- Finally, a second for loop runs x times to append x zeros to *ans*.

**5.Return:**

- The function returns the list ***ans***.


# Approach
<!-- Describe your approach to solving the problem. -->
- **Merge and Double:** Iterate through nums, double adjacent equal elements, set the second to zero, and store results in l.

- **Filter Non-Zero:** Collect all non-zero elements from l into ans.

- **Fill Zeros:** Append zeros to ans to match the original list's length and return ans.

# Complexity
- Time complexity: 0 ms
<!-- Add your time complexity here, e.g. $$O(n)$$ -->


- Space complexity: 18.24 mb
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def applyOperations(self, nums: List[int]) -> List[int]:
        l=[]
        ans=[]
        x=0
        for i in range(len(nums)-1):
            if nums[i] == nums[i+1]:
                nums[i] = 2*nums[i]
                nums[i+1]=0
                l.append(nums[i])
            else:
                l.append(nums[i])
        l.append(nums[-1])
        for i in l:
            if i!=0:
                ans.append(i)
            else:
                x+=1
        for i in range(x):
            ans.append(0)
        return ans

        
```
['Python3']