• Custom User Avatar

    your solution looks fine but is a bit slower but still it gets the work done! so yeah the codes effective but not efficient.

  • Custom User Avatar

    != is not the problem

    you are iterating through the friends list, and within the loop, removing items, which means that all items aren't looped through

    log the value of item before the if statement

    better to use another list/algorithm