I don't understand what happened i couldn't pass "Jungle Comping" issue 3rd test. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I don't understand what happened i couldn't pass "Jungle Comping" issue 3rd test.

string str = Console.ReadLine(); string[] hearArr = new string[str.Split(" ").Length]; hearArr = str.Split(" "); IDictionary<string, string> animalsHear = new Dictionary<string, string>(); animalsHear.Add("Grr", "Lion"); animalsHear.Add("Rawr", "Tiger"); animalsHear.Add("Ssss", "Snake"); animalsHear.Add("Chirp", "Brid"); //Console.WriteLine(animalsHear.ContainsKey("tiger")); for(int i=0;i<hearArr.Length;i++) { if (animalsHear.ContainsKey(hearArr[i])) { Console.Write(animalsHear[hearArr[i]]+" "); } }

10th Jan 2022, 6:30 PM
Behzodjon Nosirov
Behzodjon Nosirov - avatar
2 Answers
+ 3
Behzod NOSIROV with the one line of code above you didn’t pass test 1 or 2 either. What does the inserted question have to do with yours? EDIT: I see you cleaned the question up, added the rest of your code and deleted the reference to the unrelated Discuss question. Good Work! 👍
10th Jan 2022, 6:45 PM
Paul K Sadler
Paul K Sadler - avatar
+ 2
Behzod NOSIROV Always check your code carefully. You spelled Bird wrong, it is not Brid. The logic itself was fine.
10th Jan 2022, 8:19 PM
Paul K Sadler
Paul K Sadler - avatar