Given a directed graph represented by its adjacency list adj[][], determine the in-degree (number of incoming edges) and out-degree (number of outgoing edges) for every vertex in the graph.
The main idea is to calculate the in-degree and out-degree of each vertex by traversing the adjacency list. The out-degree of a vertex i is equal to the number of vertices present in its adjacency list adj[i], and for the in-degree, we increment the count for each vertex j that has an incoming edge from the current vertex i by one.