They used an advanced algorithm called counting:
AP concluded that Hillary Clinton had enough delegates to clinch the nomination after a painstaking but very straightforward exercise.
By Monday evening, 571 superdelegates had told us unequivocally that they intend to vote for Clinton at the convention. Adding that number to the delegates awarded to Clinton in primary and caucus voting to date gave her the number needed to be the presumptive nominee.
That is news, and reporting the news is what we do.