P19980 [GeeksforGeeks] Tiger zinda hai5531
普及-
题目描述

Rohan is downloading the movie Tiger Zinda Hai using a torrent website, but he is new to torrent, so he doesn't know the difference between a fake download button and a real download button; therefore, he keeps pressing every button in excitement.
Now he has clicked N buttons, and many tabs are opened, if an opened tab is clicked again then it closes it.
Your task is to tell how many tabs are open at the end.
Example 1:
Input : Arr[] = {"1", "2", "1", "END", "2"}
Output : 1
Explanation:
In the above test case, firstly tab
1st is opened then 2nd is opened then
1st is closed then all are closed
then again 2nd is opened.
Example 2:
Input : Arr[] = {"1", "2", "END"}
Output : 0
Your Task:
This is a function problem. The input is already taken care of by the driver code. You only need to complete the function count_tabs() that takes an array of String (arr), sizeOfArray (n), and return how many tabs are open at the end. The driver code takes care of the printing.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(N).

Constraints:
1 ≤ N ≤ 10^{5}

输入格式

见题面

输出格式

见题面

样例输入
Arr[] = {"1", "2", "1", "END", "2"}
样例输出
1