MeetCode
Graph Handshaking Lemma
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Graph Handshaking Lemma
Easy
Computer Mathematics
Graph Theory Basics
32 views
Explanation
Complexity
Problem Statement
Given degrees of all vertices, print YES if sum of degrees is even.
Input Format
n then n degrees.
Output Format
YES or NO.
Example
Input
3 1 2 3
Output
YES
Constraints
degrees>=0
Input / Output Format
Input Format
n then n degrees.
Output Format
YES or NO.
Constraints
degrees>=0
Examples
Input:
3 1 2 3
Output:
YES
Example Solution (Public)
Computer Mathematics
In any graph, sum of degrees = 2E, must be even. Check sum%2==0.
Official Solution Code
Wrap
Copy
In any graph, sum of degrees = 2E, must be even. Check sum%2==0.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
3 1 2 3
Expected Output
YES
Compile Output
Error
Output
Please
login
to submit solutions.