Problem Statement | |||||||||||||
Given a directed graph on n vertices, your task is to label its vertices as follows:
| |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | int[] a comes before int[] b lexicographically if a[i] < b[i] , where i is the first position in which a and b differ. | ||||||||||||
Constraints | |||||||||||||
- | m will contain between 1 and 50 elements, inclusive. | ||||||||||||
- | Each element of m will contain exactly n characters, where n is the number of elements in m. | ||||||||||||
- | Each character in each element of m will be '1' (one) or '0' (zero). | ||||||||||||
- | The i-th character of the i-th element of m will be '0'. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|