what is the purpose of 了 in this sentence ?
了 is a past tense marker. It means the action was already completed. In this case, it means I saw your kid.
Be careful. Many speakers of European languages often equate 了 with past tense. While It can be translated that way, that's not what 了 really is. Rather than tense, it represents aspect, in this case a completed aspect of the verb. Remember that Chinese has no tense. A lot of European language speakers, when starting out speaking Chinese, tend to add 了 wherever they would use past tense in their native languages, and it makes their Chinese sound very unnatural.
了 has two main functions. One is past tense, but the more important function is change of state. In this sentence, 了 means past tense completion, but it also refers to, "I didn't see the kid before, but now I do."
I don't know, the second part about seeing not seeing the child before isn't really hinted at here.
The use of 了 is quite complicated. If you're interested in an article which tries to explain it, it's here: https://www.chineseboost.com/grammar/le-grammar-summary/
That being said, I still don't quite get it, and I'm not sure that Duolingo is the best place to clarify it completely.
true, but in this case, as others have said, its to move the action 'see' to the past.
To show the completion of the action indicated by the verb written just before the "了".
As a Chinese, I think that 了 refers to both past tense and situations like this:
can you see (it)? I can see (it).
idk how to explain it XD I think it also refers to something that has "begun to happen".