code: public static int countChildrenOf(int[] parents, int parent) {
          int count = 0;
          for (int i=0; i<parents.length; i++) {
              if (parents[i] == parent) {
                  count++;
              }
          }
          return count;
      }
docs: Counts of the number of children in a dependency tree for the given
  parent index.
  
  @param parents
  A parents array where parents[i] contains the index of the
  parent of the word at position i, with parents[i] = -1
  indicating that the parent of word i is the wall node.
  @param parent The parent for which the children should be counted.
  @return The number of entries in <code>parents</code> that equal
  <code>parent</code>.