Keys pressed in specific order

Hi ! I’m quite a beginner in scripting on Unity, but I’m currently working on a short game project for my degree. What I want to achieve :
The player has 5 notes (music notes) at his disposal, and he can play them whenever he wants and in any order. However, there are melodies (a series of 5 notes, same note can be used several times) that the player knows, and if he plays notes in the order that corresponds to one of the melodies, it activates its power. For exemple the first one make plants around the player grow.
Any idea how i can treat that, staying as simple simple as possible for the beginner that i am ?

Thanks a lot, have a great day !

The following code has not been tested and may be too complicated or too complete, but will cover your needs. I’ve commented it to be as clear as possible

// Specify the keycodes in the inspector
public KeyCode[] KeyCodeSeries = new KeyCode[] { KeyCode.Alpa1, KeyCode.Alpha2, KeyCode.Alpha3 } ;

// Use this if you want the user to press the series of keys in a given times interval
public float DelayBeforeReset = 86400; // = One day

// Specify in the inspector the function you want to call
// after the series have been completed
public UnityEngine.Events.UnityEvent OnSeriesComplete;

// Specify in the inspector the function you want to call
// after the series have been failed because a wrong key has been pressed
public UnityEngine.Events.UnityEvent OnSeriesFailed;

// Specify in the inspector the function you want to call
// after the series have been failed because the user did not pressed the key before the end of the delay
public UnityEngine.Events.UnityEvent OnTimeRunnedOut;

// The index in the array of the next key to press in order to continue the series
private int keyCodeIndex ;

// The time (in seconds) the last correct key has been pressed
private float lastKeyPressTime;

private void Update()
{
    // Make sure some keys have been specified in the inspector 
    if( KeyCodeSeries.Length == 0 )
        return ;

    // Check if the user pressed the key before the end of the timer
    if( Time.time - lastKeyPressTime > DelayBeforeReset )
    {
        keyCodeIndex = 0 ;
        if( OnTimeRunnedOut != null )
            OnTimeRunnedOut.Invoke();
    }

    // Correct key pressed!
    if( Input.GetKeyDown( KeyCodeSeries[keyCodeIndex] ) )
    {
        lastKeyPressTime = Time.time;
        keyCodeIndex++ ;

        // Series completed!
        if( keyCodeIndex >= KeyCodeSeries.Length )
        {
            if( OnSeriesComplete != null )
                OnSeriesComplete.Invoke();
            
            // Reset index to allow to start again
            keyCodeIndex = 0 ;
        }
    }
    // Wrong key pressed!
    else if( Input.anyKeyDown )
    {
        keyCodeIndex = 0 ;
        if( OnSeriesFailed != null )
            OnSeriesFailed.Invoke();
    }
}

@Hellium Thanks a lot for the fast and complete answer ! I’ll try my best with this one !