It is ineffective solution open file, write little content, close file. Your solution did not pass the tests by time