Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
924. Minimize Malware Spread
Bookmark
Input
Example 1
Example 2
Example 3
Two Components
Different Sizes
6 Nodes
Custom
graph
=
[[1,1,0],[1,1,0],[0,0,1]]
,
initial
=
[0,1]
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
root
2
root
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
root
2
root
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Remove Node: 0 | Saves: 0 nodes
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Remove Node: 0 | Saves: 0 nodes
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Remove Node: 0 | Saves: 0 nodes
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Remove Node: 0 | Saves: 0 nodes
Legend:
Healthy
Infected
Analyzing
Best Choice
Network Graph
0
1
2
Infected Nodes: [0, 1]
Union-Find Components
0
root
1
2
root
Remove Node: 0 | Saves: 0 nodes
Legend:
Healthy
Infected
Analyzing
Best Choice
algo
master
.
io
Step:
Given a network of 3 nodes with 2 initially infected nodes: [0, 1]. Find which infected node to remove to minimize total infection spread.
0 / 9
Input
Example 1
Example 2
Example 3
Two Components
Different Sizes
6 Nodes
Custom
graph
=
[[1,1,0],[1,1,0],[0,0,1]]
,
initial
=
[0,1]
0 / 9
algo
master
.
io
Step:
Given a network of 3 nodes with 2 initially infected nodes: [0, 1]. Find which infected node to remove to minimize total infection spread.