8 kyu
Filter out the geese
22,970 of 44,231stevehopkinson
Loading description...
Arrays
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
missing fixed tests for js
I found the discription a bit hard at first, but then I understood it.
It's not really that hard. Clear instructions: You have a list of geese already made. You just remove any item common in the geese list and the array to be filtered you get. That's it?
Needs better instructions.
I wouldn't say it's an 8th-level kata
Shorter description:
Create a function that removes specific bird species, known as 'geese', from a provided list.
What exactly shoul I do? Don't understand the Kata at all.
Everything is in the title: Filter out the geese.
For CoffeeScript
The geese are any strings in the following array, which is pre-populated in your solution
is not true, there is nothing pre-populatedCan someone explain me the description. Please, i can understand what does geese means(i thought it is like animal). And, if it is possible, in Russian
It is an animal.
You need to iterate through the array thats passed in as a parameter and remove any that are geese.
Sorry don't speak Russian.
For example, if this array were passed as an argument:
["Mallard", "Hook Bill", "African", "Crested", "Pilgrim", "Toulouse", "Blue Swedish"] Your function would return the following array:
["Mallard", "Hook Bill", "Crested", "Blue Swedish"]
Why in example we remove 'African' why is it geese? What is the logic? Maybe i understood something wrong
Oh. I just googled, ["Mallard", "Hook Bill", "Crested", "Blue Swedish"] are different ducks, i just thought it is some random words :/
Aye, english is weird!
glad you figured it out tho.
Чел, у тебя есть список 'geese'. Тебе надо написать функцию, которая принимает список птиц 'birds' и отфильтровывает её таким образом, чтобы, в итоге, не осталось ни одной птицы из списка 'geese'.
Пример: есть список a = [1, 2, 3, 4] подаётся список b = [1, 3, 5, 8, 9] фильтруем так, чтобы, в итоге, в b не было ничего из a ... получаем список [5, 8, 9] Кчау
This comment has been hidden.
Using
remove
on lists while iterating through them with afor
loop can cause parts of the list to be skipped, which is what's happening in your code.Что такое Гуси? ))
The instructions were unclear. I needed to read the comments for them.
YOU ARE GIVEN 2 LISTS: ONE OF GEESE AND ANOTHER ONE TO MODIFY. YOU MUST REMOVE THE GEESE FROM THE SECOND LIST.
Drop the caps, please.
I don't know and I can't find how i can edit a comment...
edit button under comment
This comment has been hidden.
It seems you messed up the sample tests, backup your code, click Reset, paste it and try again, they should look like this:
Thank you, worked!
I can't understand the logic output this Kata.
For example test without 'geese': ['Pippi', 'Roc', 'Tiamat', 'Wyvern'] should equal ['Pippi', 'Roc', 'Wyvern', 'Tiamat']
Why 'Pippi'and 'Roc' don't change position in out list, but 'Tiamat' and 'Wyvern' changed position?
Neither of those is the input, print it to see it's your code that changes the order. The first value is what your function wrongly returned, the other is the expected value.
This comment has been hidden.
I didn't understand this Kata.
Instructions unclear. Computer was thrown out window.... now what?
Was it because of this Kata or your FTX investment?💀
All of the above 😂
This comment has been hidden.
lol... this is kyu 8? ridiculous hard...
Absolutely agree, more deserving of 6 kyu minimum
This comment has been hidden.
I think it depends on the coding language. As far as I can tell python was pretty easy. C# was way to hard with its datatype iEnumerable. I wasn't able to solve it within 15 minutes even after googling after this datatype. Just an array of strings whould have been more apropriated for 8.Kyu
Why does this kata use
iEnumerable<string>
as it's return and paramater types? This would be a lot simpler to work with had it beenstring[]
given the nature of working with lists here. This is 8 kyu after allScala translation
.
For a non US native language, its really hard to answer this question , even with translator its hard to understand, its more harder to predict the test cases... Sorry !
I didn't understand this Kata.
Think in terms of what you are actually doing and checking for in the list.
Description could use a re write for clarity, it's "understandbale" sure, but a lot of people clearly arent understanding it, therefor it reasons that it should be rewritten to be more clear.
More descriptions, please. Not clear ...
COBOL translation + description unified (author is inactive).
approved
The description is not clear.
I've just read it again, and it seemed clear to me. What would you suggest to improve it?
Can someone explain to me this kata with simple words? thanx a lot.
Return list
ofbirds
that not in the list ofgeese
.C++ translation kumited
Java Translation
Just wanted to say I still have this translation that hasn't been approved. It seems like the author of this kata is MIA.
This comment has been hidden.
This comment has been hidden.
Forked python translation with new test framework used and 3.8 enabled
This comment has been deleted.
This comment has been hidden.
It's good practice to name your condition in a constant or function like const
isGoose = //your condition
This makes code more readable.Racket translation
Julia translation
PHP translation kumited 😂🙂😁😇😊
I found the bird "theme" of this kata's Details very distracting.
Here's a genericized description for those who want to parse through the fluff.
Given 2 string arrays:
array1 = ["A", "B", "C", "D", "E"] array2 = ["B", "D"]
Return array1 without the elements in array2.
E.g. return ["A", "C", "E"]
Fun and challenging Kata. I had a hard time testing this one for some reason.
Incorrect types are used in TypeScript in the initial solution and in the tests (
[string]
instead ofstring[]
), which makes TS 3.3 unavailable.fixed
Not fixed in the initial solution yet.
Hi all. I am new to this.
I have written some code to solve this challenge and received this result - Time: 635ms Passed: 12 Failed: 0 Exit Code: 1 - when I attempt the challnge.
What does this mean? What is Exit Code 1? Have I still got errors?
Thanks for your help
Is it just me, are the Details for the activity misleading/incorrect? The explanation does not state tehre more than one array will be passed in as an argument. I've written a perfectly fine function to return with the geese removed from a single array but fails where a second, seperate array has been passed in in the test cases. Am I missing something? Sorry, still pretty new to all this!
That means your function should use that to work, not work with a fixed input, that kind of function isn't very useful don't you think? The details are ok, it could be that you're new.
ruby test is expecting "banned" geese in the return, which is against what the task says it should.
Passed 24, failed 20. All failed has "banned" geese in the expectation?
Expected: ["Steinbacher", "Toulouse", "Blue Swedish"], instead got: ["Blue Swedish"]
"Actual" and "expected" values were switched. Fixed now.
TypeScript translation avalaible, please add it
Approved, although you didn't add typescript examples to the description.
This comment has been hidden.
Because you're modifying the list while iterating over it.
And in this way the code essentially skips over some elements. I wrote it all out step by step and I see now. Thank you very much, that was most helpful!
Can you explain me what is 'geese', ha ha? Sorry, i am russian.
geese is the initial array of string values presented on this exercice. I have also got confused because I couldn't see it! haha
A goose is a bird. Geese is more than one goose (ploral)
Гуси:)
This comment has been hidden.
Fixed. The author didn't care to fix it after a year it seems.
The test is still broken, returning 'geeses' should not pass the test because it's what you don't want.
Fixed.
.
This comment has been hidden.
language?
javascript
Can someone please give me a head start. I'm not sure where to begin with here. Thanks!
For which language?
javascript
Hi!
First of all, thanks for this kata.
As glynester indicated 8 months ago in a comment, passing any string in the return statement allows you to pass the challenge.
Fixed.
Hi, please consider reviewing and approving this C# translation
Puzzle description: Note that ... some elements may be repeated.
Actual tests: no repeated elements
Model solution: wouldn't work with repeated elements
Ah, to think that once you were able to do such complicated katas, while... Just look at you now :(!
Anyway, Python and Crystal translations submitted, feel free to approve them before checking the other two pending translations.
Cheers :)
Yet another kata I can't translate to python because you are quicker... That only leaves me with one option - learn C better :D
Unless I beat you to that too :p
And, confess: you cannot translate this kata as it was way too difficult for you :(!
You got me... I managed to solve it only by smashing random keys and pressing Attempt untill it passed all the tests.
Javascript:
return "Ham and eggs";
All tests pass. Something wrong there!
There's a C# translation: https://www.codewars.com/kumite/57ee9e116c8df7e549000021?sel=57ee9e116c8df7e549000021