#3310

Remove Methods From Project

specialist · 890 · lc medium +31 · 50.4% accepted · 156 likes · top 38%

Description

You are maintaining a project with n methods (0 to n - 1). Given integer k and invocations where invocations[i] = [ai, bi] means ai calls bi. Method k has a bug; it and all methods it invokes (directly or indirectly) are suspicious. Remove all suspicious methods only if no non-suspicious method calls any of them; otherwise remove none. Return the remaining methods.

Code

1
2
3