Is ethical to rewrite tutor work and submit it?
First: That you take into account a &quot;similarity report&quot; sounds worrying. Of course it is possible to commit plagiarism which a similarity report cannot detect (reformulation of ideas or translations, for example). You might want to read up or ask around what plagiarism is.
Next: What you did sounds very much like cheating (if the expectation was to do this task on your own): You got the idea from somewhere else and rewrote it. It seems to me that rewriting was not the idea of the task. &quot;Rewriting&quot; sounds to me like &quot;changing variable names, restructuring, exchanging loops, some functions&quot; but not like thinking again etc.
Finally: Whether this is considered cheating (and if the assignment was &quot;important enough&quot; to consider some action &quot;cheating&quot;) is up.to the prof and your university. You might want to ask them. If you don't want to, this most likely either means your prof is unreasonable or you yourself consider your action to be wrong.