People judge you by how they find a place or a work after you leave it. The bad thing is, that they will do it, even if you are not the one responsible for the mess.
Are you the last one to leave an office and there is an open window? You are responsible even if you did not opened it. Have you just left a shower in a gym, and there is a mess you did not cause? The person after you will think you have caused the mess. There is an obvious, easily discoverable bug in a code? You are responsible, because you did not test it properly and fixed it.
Sometimes it is fair, sometimes it is unfair. But you should keep in mind, that whenever you are leaving a place or a task, you want to make it better than you have found it. With this approach, you cannot go wrong.
Is the shower dirty when you come in? Clean it before you leave. Is something missing in your product documentation? Add it in, even if it is not your responsibility.
People will find things after you left them in a good state, and their opinion of you will also be good.
The alternative is you, leaving a toilet dirty, beacause it was dirty as you came in, and did not want to clean someone elses mess, and your colleague whom you meet while leaving will think, that you cannot use a toilet brush.