# [Community Puzzle] XML MDF-2016

Coding Games and Programming Challenges to Code Better

Hi, i think in test 6 it’s mistake.
Because in my program letters “n” and “u” had more weight.

maybe I have a mistake, or maybe creators need to recount the weight

The mistake is on your side I think. It works for me and others.

Could someone pls tell me why ‘a’ the expected result is at testcase #2?
Input is: ab-b-a
So depth of ‘a’ is 2, ‘b’ is 1, so weihts are ‘a’ 1/2, ‘b’ 1/1.
By this definition, ‘b’ should be the result, isn’t it?

1 Like

“In this challenge you must determine the letter of the tag with the greatest weight in the string argument.”
depth of a is 1, depth of b is 2
weight of a is 1/1
weight of b is 1/2=0.5
so result is a

Something may be misunderstood by me, but I find:
“Now we define the depth of a tag as 1 + the number of tags in which it is nested.”

Doesn’t it mean in “ab-b-a” depth of a is 2 because it has one nested tag, and depth of b is 1, because it has no nested tags?
And if so, how could all other testcase work, why is just this one wrong?