For this Question: Given a binary tree, count the number of leaves in it. A node having no child node is called a leaf.The first line contains the integer N, denoting the number of nodes in the binary tree.
Next N lines contain two integers, denoting the left and right child of the i-th node respectively. 
If the node doesn't have a left or right child, it is denoted by '-1'

1 <= N <= 100000Print the number of leaves in the binary treeSample Input 1:
7
2 4
5 3
-1 -1
-1 7
6 -1
-1 -1
-1 -1

Sample output 1:
3

Explanation: Given binary tree 
                1
               /  \
             2     4
            / \      \
          5    3     7
         /
       6 
Node 3, 6, 7 are the leaves here, I have written this Solution Code: #include "bits/stdc++.h"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 1e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int l[N], r[N], v[N];

void solve(){
	int n;
	cin >> n;
	int ans = 0;
	for(int i = 1; i <= n; i++){
		int x, y;
		cin >> x >> y;
		if(x+y == -2)
			ans++;
	}
	cout << ans << endl;
}

void testcases(){
	int tt = 1; 
	//cin >> tt;
	while(tt--){
		solve();
	}
}

signed main() {
	IOS;
		clock_t start = clock();

	testcases();

	cerr << (double)(clock() - start)*1000/CLOCKS_PER_SEC << " ms" << endl;
	return 0;
}	, In this Programming Language: C++, Now tell me if this Code is compilable or not?