“And whosoever fears Allaah and keeps his duty to Him, He will make a way for him to get out (from every difficulty).
And He will provide him from (sources) he never could imagine. And whosoever puts his trust in Allaah, then He will suffice him. Verily, Allaah will accomplish his purpose. Indeed Allaah has set a measure for all things”[al-Talaaq 65:2-3]
What your teacher has told you goes against the words of Allaah:
“Tell the believing men to lower their gaze (from looking at forbidden things), and protect their private parts (from illegal sexual acts). That is purer for them. Verily, Allaah is All‑Aware of what they do”[al-Noor 24:30 – interpretation of the meaning]
And the Prophet (peace and blessings of Allaah beu pon him) said in a saheeh hadeeth: “Avert your gaze.” (Narrated by Ahmad, 18715; Muslim, 2159). Who is more deserving of being obeyed, Allaah and His Messenger, or your teachers?!
So I advise you to adhere to taqwa and to keep away from that which is haraam. Allaah will make it easy for you by His Leave and His Bounty. You can find more discussion on the rulings on looking at women in the answer to Question # 1774. Please refer to this as it is important.
May Allaah give you strength and make things easy for you.