Erase Securely Kattis Solution in Python 3.
If you want to look at the question of erase securely on kattis click on this Erase Securely Kattis
How did I solve it?
Considering that you have understood the problem carefully let me jump directly to the logic of the code. If the number of times the write operation is performed is even then the file before and after deletion will be the same. Therefore, the deletion fails and the message 'Deletion Failed' is displayed. If it is not even then we compare bits by bits the file before and after deletion, if there is even a single bit difference then we display the message that the file 'Deletion successful'.
The erase securely kattis solution in python 3 source code is given below.