I have been asked in a programming contest if it is possible to construct a graph just with the degree numbers. For example, given $1,2$ the answer would be no by the handshake lemma, but that's a sufficient condition, not a necessary condition. The question is: there is any way to answer this in polynomial time?
Thanks