Ashish and Binary Matrix
Practice
3.7 (21 votes)
Ad Hoc
Approved
Easy
Math
Open
Problem
74% Success 6678 Attempts 20 Points 2s Time Limit 256MB Memory 1024 KB Max Code

Pulkit is really good at maths. Recently, he came to know about a problem on matrices. Amazed by the problem he got, he asked Ashish the same problem. Ashish also being good at maths solved the problem within 5 minutes. Now, its your time to solve the problem.

You will be given n*m binary matrix. You need to tell if it is possible to delete a column such that after deleting that column, rows of the matrix will be unique. If yes than print "Yes" else print "No".

[Input]
First line contains an integer t denoting no.of test cases.
Next line contains 2 integers n and m denoting no.of rows and columns.
Next n line contains binary string of length m each.

[Output]
For each test case output "Yes" or "No".

[Constraints]
1<=t<=100
1<=n<=1000
2<=m<=1000

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
629 votes
Tags:
AlgorithmsApprovedEasyHiringOpenReadySorting
Points:20
17 votes
Tags:
AlgorithmsBasic ProgrammingEasyString Manipulation
Points:20
642 votes
Tags:
Ad-HocEasyOpenString Manipulation