public static int countLeavesAtLevel(TreeNode<Integer> t, int level) {
		if (t == null || level < 0) {
			return 0;
		}

		/* at the specific level */
		if (level == 0) {
			if (t.right == null && t.left == null) {
				return 1;
			} else {
				return 0;
			}
		} else {
			return countLeavesAtLevel(t.left, level - 1)
					+ countLeavesAtLevel(t.right, level - 1);
		}
	}