For this Question: You are given a stream of integers represented by an array <b>arr[]</b> of size <b>N</b>. Whenever you encounter an element arr[i], you need to increment its <b>first occurrence</b>(on the left side)if present in the stream by 1 and append this element in the array. You don't have to do this when you encounter arr[i] for the first time as it is the only occurrence till then. Finally, you need to print the updated array.The input line contains T, denoting the number of testcases. Each testcase contains two lines. First line contains N, size of array. Second line contains elements of array separated by space.

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= 10^4
1 <= arr[i] <= 10^5
For each testcase you need to print the updated array in a new line.Input:
1
10
1 2 3 2 3 1 4 2 1 3

Output:
4 5 3 2 3 2 4 2 1 3

Explanation:
Testcase 1: We encounter 1, 2, 3.  We encounter 2 again so we increment its leftmost occurrence by 1. The updated array becomes 1 3 3 2. We encounter 3 next. So we increment its left most occurrence by 1. So updated array is 1 4 3 2 3. Next we encounter 1, so we increment the leftmost occurrence of 1 by 1. New updated array is 2 4 3 2 3 1. Next we encounter 4, so we do the same and increase its first occurrence by 1. New updated array is. 2 5 3 2 3 1 4. Next we encounter 2, so we do the same and increase its first occurrence by 1. New updated array is. 3 5 3 2 3 1 4 2. Next we encounter 1, so we do the same and increase its first occurrence by 1. New updated array is 3 5 3 2 3 2 4 2 1. Next we encounter 3, so we do the same and increase its first occurrence by 1. New updated array is 4 5 3 2 3 2 4 2 1 3. , I have written this Solution Code: from collections import deque
from heapq import heapify,heappush,heappop
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int,input().split()))
	hash_map = {}
	new_arr = []
	# for i in range(n):
	# 	# print(hash_map)
	# 	# print(new_arr)
	# 	if arr[i] not in hash_map:
	# 		hash_map[arr[i]] = i
	# 		new_arr.append(arr[i])
			
	# 	else:
	# 		temp = hash_map[arr[i]]
	# 		new_arr[temp] += 1
	# 		hash_map[new_arr[temp]] = temp
	# 		new_arr.append(arr[i])
	# 		if arr[i] not in hash_map:
	# 			hash_map[arr[i]] = i
	# 		else:
	# 			hash_map[arr[i]] = new_arr.index(arr[i])
	
	for i in range(n):
		# print(hash_map)
		if arr[i] not in hash_map:
			heap = []
			heapify(heap)
			heappush(heap,i)
			hash_map[arr[i]] = heap
			new_arr.append(arr[i])
		else:
			index = heappop(hash_map[arr[i]])
			# print(index)
			new_arr[index] += 1
			if new_arr[index] not in hash_map:
				heap1 = []
				heapify(heap1)
				heappush(heap1,index)
				hash_map[new_arr[index]] = heap1
			else:
				heappush(hash_map[new_arr[index]],index)
			heappush(hash_map[arr[i]],i)
			new_arr.append(arr[i])
	# temp = heappop(hash_map[1])
	# print(hash_map)
	for i in new_arr:
		print(i,end=" ")
	print(), In this Programming Language: Python, Now tell me if this Code is compilable or not?