All Problems

Problem title

Difficulty

Avg time to solve

Topological Sorting

Moderate

30 mins

BST Delete

Easy

15 mins

Set K Bits

Easy

10 mins

X OR Y

Easy

15 mins

Braille's Dilemma

Hard

15 mins

Increasing Subsegment

Moderate

15 mins

Print Common Elements

Easy

15 mins

Check If Path Exists

Easy

10 mins

Sum Of K Smallest Elements In BST

Easy

15 mins

Reachable Nodes

Easy

10 mins

Problem

Submissions

3

Avg. time to solve

30 min

Success Rate

60%

Problem Statement

```
The first line of input contains an integer T, the number of test cases.
The first line of each test case contains two single space-separated integers V, and E.
From the second line onwards of each test case, the next 'E' lines will denote the edges of the graph where every edge is defined by two single space-separated integers 'a' and 'b', which signifies an edge from vertex 'a’ to vertex 'b'.
```

```
For each test, case output will be "Correct" if the topological sort is done correctly else it will be "Incorrect".
```

```
1 <= T <= 10
1 <= V <= 1000
0 <= E <= 3000
0 <= U, V <= V-1
Time Limit: 1sec
```

```
1
5 4
0 2
1 2
3 1
0 4
```

```
Correct
```

```
One correct sort order is : 3 1 0 4 2.
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code