I have having trouble figure out how to write this code.
I have a list of items, the items all have an ID. There is also another value that we will call otherID. If otherID is zero or null, we will ignore it. However, if otherID contains the ID of another item in the list, I want to remove that item from the list.
Example:
item1.ID = 5, item1.otherID = null
item2.ID = 6, item2.otherID = 5
item3.ID = 7, item3.otherID = null
so item1 should be removed from the list because it's ID is present in the otherID field of item2
Any one know how I would write this?