An algorithm to solve open and closed‐shell and restricted MC–SCF equations