MeetCode
Relation Reflexive Check
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Relation Reflexive Check
Medium
Computer Mathematics
Sets, Relations & Functions
26 views
Explanation
Complexity
Problem Statement
Given n and a list of pairs (a,b), check if relation is reflexive.
Input Format
n m then m pairs.
Output Format
YES or NO.
Example
Input
3 2 1 1 2 2
Output
NO
Constraints
1
Input / Output Format
Input Format
n m then m pairs.
Output Format
YES or NO.
Constraints
1
Examples
Input:
3 2 1 1 2 2
Output:
NO
Example Solution (Public)
Computer Mathematics
Check whether all (i,i) pairs exist for i=1..n. Use a set of pairs.
Official Solution Code
Wrap
Copy
Check whether all (i,i) pairs exist for i=1..n. Use a set of pairs.
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 2 1 1 2 2
Expected Output
NO
Compile Output
Error
Output
Please
login
to submit solutions.