# H Distance Coderbyte challenges

Can you simply explain what they want from me in coderbyte challenge? I am really new and stuck H Distance

Have the function HDistance(strArr) take the array of strings stored in strArr, which will only contain two strings of equal length and return the number of characters at each position that are different between them. For example: if strArr is [“house”, “hours”] then your program should return 2. The string will always be of equal length and will only contain lowercase characters from the alphabet and numbers.

Examples

Input: [“10011”, “10100”]
Output: 3

Input: [“abcdef”, “defabc”]
Output: 6

here is the function:

def HDistance(strArr):

return strArr

# keep this function call here

print HDistance(raw_input())

so you need help with a

welcome to codadamy forms 1 Like

Hi thank you! Sorry I submitted the one I posted question about already. but here is the new one I am doing on H Distance if you can help pls Coderbyte | The #1 Coding Assessment Platform

1 Like

what is the codbyte challange called?

I think it is called H Distance

1 Like

what it wants I think it to find the difference from the 2 strings. hope this helps
happy coding 1 Like

Did anyone solve this? No matter what I put it either comes up with the words I used as examples or the number 0 or 1 depending on how I change the code

It may be easier to help if you share your code.
The return should not be in the loop.

def HDistance(strArr): length = min(len(strArr), len(strArr)) h = 0 for j in range(length): if (strArr[j] != strArr[j]): h += 1 return h print(HDistance(["10011", "10100"])) print(HDistance(["abcdef", "defabc"])) print(HDistance(["house", "hours"]))