#[Go] Bird Watcher confusion.

4 messages · Page 1 of 1 (latest)

harsh ether
#

Can someone please explain what exactly we are being asked to return as an integer for the "Birds of the week" second function in this challenge?
To be quite frank I find the explanation as clear as mud, and I tried to work it out from the tests but I'm still none the wiser.

So I know we're being given a slice of integers which represents a "bird count" and an integer "week" but I have no idea what the tests are expecting me to return for this. Are we assuming a week is 7 days? 5 days? Does it even matter? What Does the week integer represent? Is it the number of weeks this count happened? Am I supposed to divided the slice by 7 and assume if week is one, I sum those 7 values for a weeks worth or what?

I'm really frustrated with this one, it feels like the metaphor is so ambiguous it's distracting me from learning how to actually complete the task, because I can't even work out what the task is.

Thanks in advance for your help. 🙂

low mica
#

Hey there. I'm looking at the probelm now, and the explanation and example make it pretty clear to me. Your function is provided an integer array representing daily bird visits, and an integer representing WHICH week you're supposed to sum from the array. The week number (2 in the example) is the OFFSET of weeks you need to calculate your 7 indicies to sum for the proposed week. So if you're passed week two you want to sum the second week in the slice, 7-13. (first week is 0-6, third week is 14-20, etc)

#

look at the example array and function call. And manually sum the integers from 7-13 inclusive and see if you get the 12 it says will be returned. Then emulate the behavior in your own function.

harsh ether