Choose the correct option to replace the underlined part into make a grammatically correct sentence.
Had he realized how close he was to failing, he would not have gone to the party.
1
If he would have realised how close he was to failing, he would not have gone to the party.
2
Had he had realised how close he was to failing, he would not have gone to the party.
3
When he realized how close he was to failing, he would not have gone to the party.
4
Had he realised how close he was to failing, he would not have gone to the party.