"Nice to meet you!"
It can be both actually, depending on what you need in English.
「はじめまして」 (hajimemashite) itself means something like "it's a beginning!" or "it's the first time (we're meeting)!". It's a Japanese thing that doesn't really exist in English as far as I know. Some people translate it as "hello", but you wouldn't say 「はじめまして」 to someone you've met before, that's just awkward, you don't say "Hey nice to meet you" to your friend when you run into him randomly in a store.
「よろしく」is short for 「よろしくおねがいします」. This is another Japanese thing that doesn't have a 1 to 1 equivalent in English. It literally means "I request well". 「よろしい」- it's an adjective meaning "well, good", by replacing the final い with a く you get an adverb which you can use to modify a verb. 「おねがいします」is a verb meaning "I wish, I request". You put 「よろしく」in front of 「おねがいします」and you end up with something that means "I request goodly" or "I kindly request", you get the idea. When you introduce yourself and say that it means something like "Be nice to me" or "Let's be nice to each other" or "Hey let's have a fruitful relationship". It's a Japanese thing. You can also use it when you ask someone to do a favor for you, then it means something like "Thank you in advance".
But if you're doing an introduction, はじめまして is always said first, so it would be something like 「はじめまして、ジョンです、よろしくおねがいします！」
I think it's trying to teach us multiple ways to say it. Like "thanks," thank you," and "thank you very much."
I just want to point out that I entered " よろしくおねがいします " and was marked wrong for it. I'm majoring in Japanese studies at university (I've been using Duolingo to review the basics), and this is exactly what we're taught to use. So this being marked incorrect is a little concerning...
Yoroshiku can be used in so many different situtions, as mentioned by Konrad, it is more linked to a request
よろしく has a lot of meanings... for example teammates say it to each other when the match is beginning, or when you want to say I leave this work to you. Is that right?
I entered よろしく and it marked it wrong because I did not include the exclamation mark at the end. Some questions want よろしく!, while others want よろしくね. Some will accept はじめまして, and some won't. This section seems incredibly inconsistent.
When I click the incorrect answer, I should be able to click on the correct answer to see how it sounds. To learn the correct answer. This entire process is to learn only the correct answer.