educative.io

Input and examples on Minimize Malware Spread are terrible

All of the test inputs are edge cases and you don’t show a clear example that maps the adjacency matrix to the nodes.
Even your first example question is an edge case and it has a ridiculous explanation.
“Both nodes minimize the malware spread. So we will pick the node with the smallest index, which is 1.”
No both nodes do not minimize the malware spread, you have 2 nodes with malware in the same tree, so that network is doomed and cant be saved, it is an edge case so it defaults to the minimum. This is a stupid requirement, it should return -1 since no network can be saved.


Course: Grokking Coding Interview Patterns in C++ - Learn Interactively
Lesson: Minimize Malware Spread - Grokking Coding Interview Patterns in C++

Hello Vincent,

I hope you’re doing well.

Thank you for your feedback. After careful consideration and analysis, we believe that the output of the first example question is 1 (please refer to the screenshot attached below).

Furthermore, we have improved the example slides to make them easy for learners to understand.

We hope you enjoy your experience with us at Educative! Happy learning!

Regards
Ahmed Yasser | Technical Content Engineer
Educative.io

1 Like