These are chat archives for Codewars/codewars.com/kata-solving-help
Stuck on a kata? Ask questions here! Please keep spoilers to a minimum, though, but don't expect a spoiler free environment either.
i'm having a tuff time figuring out a kata and google isn't helping me and obviously i cannot see the solution unless i do complete it so you see my problem. i'm working on this Kata (http://www.codewars.com/kata/523f5d21c841566fde000009/train/python)
I cannot seem to remove all the duplicates form the first list, the result im getting is either [1,2,3] or [1,2,2,3]
What is your approach?
for i in b: a.remove(i) for i in a: if i not in c: c.append(i)
cis your result, I guess. So you're modifying a and appending to c?
for i in b: a.remove(i)but that only removes the first
i know the plain english of it all would be something along the lines of:
IF the value in ListB appears in List A, remove this value from ListA, copy the remaining into new ListC and print result
remove(array, value)that removes all elements