  If K is an odd-dimensional flag closed manifold, flag generalized homology
sphere or a more general flag weak pseudomanifold with sufficiently many
vertices, then the maximal number of edges in K is achieved by the balanced
join of cycles.
  The proof relies on stability results from extremal graph theory. In the case
of manifolds we also offer an alternative (very) short proof utilizing the
non-embeddability theorem of Flores.
  The main theorem can also be interpreted without the topological contents as
a graph-theoretic extremal result about a class of graphs such that 1) every
maximal clique in the graph has size d+1 and 2) every clique of size d belongs
to exactly two maximal cliques.
