The "Nintendo Games" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
As Edgy said, you will hear a different pitch bleep depending on if you have done it correctly or not. You have to do this for several rooms and if you get it wrong it starts back at the original combination.
Bear in mind this is all from memory of a game I havent played for several years and I could in fact be mixing it up with one of the other versions of Mario.
If you hear a high pitched bleep, you're doing the level correctly. If you hear a lower pitched noise, you need to try that bit again by taking a slightly different route.