{"action":"created","issue":{"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/20","repository_url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions","labels_url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/20/comments","events_url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/20/events","html_url":"https://github.com/rmotr-curriculum/advanced-python-programming-questions/issues/20","id":276709400,"number":20,"title":"Input clarification","user":{"login":"AllenAnthes","id":27715246,"avatar_url":"https://avatars1.githubusercontent.com/u/27715246?v=4","gravatar_id":"","url":"https://api.github.com/users/AllenAnthes","html_url":"https://github.com/AllenAnthes","followers_url":"https://api.github.com/users/AllenAnthes/followers","following_url":"https://api.github.com/users/AllenAnthes/following{/other_user}","gists_url":"https://api.github.com/users/AllenAnthes/gists{/gist_id}","starred_url":"https://api.github.com/users/AllenAnthes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AllenAnthes/subscriptions","organizations_url":"https://api.github.com/users/AllenAnthes/orgs","repos_url":"https://api.github.com/users/AllenAnthes/repos","events_url":"https://api.github.com/users/AllenAnthes/events{/privacy}","received_events_url":"https://api.github.com/users/AllenAnthes/received_events","type":"User","site_admin":false},"labels":[{"id":345944565,"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/labels/advanced-python-programming","name":"advanced-python-programming","color":"ededed","default":false},{"id":760316835,"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/labels/functional-programming","name":"functional-programming","color":"ededed","default":false},{"id":760316834,"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/labels/remove-duplicates-in-order","name":"remove-duplicates-in-order","color":"ededed","default":false},{"id":751568367,"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/labels/validated","name":"validated","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-24T23:14:46Z","updated_at":"2017-11-29T20:16:58Z","closed_at":"2017-11-29T20:16:58Z","author_association":"NONE","body":"Can we assume that the duplicates will always be adjacent in the input list?\r\n\r\nEdit - I know I'm probably overthinking the assignment.  My thought process is that using \"in list\" is (I believe) an O(n) operation on lists, which could be reduced to constant time if the adjacency was guaranteed.  \r\n\r\n**Assignment**: http://learn.rmotr.com/python/advanced-python-programming/functional-programming/remove-duplicates-in-order\r\n\r\n**User code**:\r\n```python\r\ndef remove_duplicates_in_order(a_list):\r\n    new_list = []\r\n    for item in a_list:\r\n        if item not in new_list:\r\n            new_list.append(item)\r\n\r\n    return new_list\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/comments/347983135","html_url":"https://github.com/rmotr-curriculum/advanced-python-programming-questions/issues/20#issuecomment-347983135","issue_url":"https://api.github.com/repos/rmotr-curriculum/advanced-python-programming-questions/issues/20","id":347983135,"user":{"login":"santiagobasulto","id":872296,"avatar_url":"https://avatars2.githubusercontent.com/u/872296?v=4","gravatar_id":"","url":"https://api.github.com/users/santiagobasulto","html_url":"https://github.com/santiagobasulto","followers_url":"https://api.github.com/users/santiagobasulto/followers","following_url":"https://api.github.com/users/santiagobasulto/following{/other_user}","gists_url":"https://api.github.com/users/santiagobasulto/gists{/gist_id}","starred_url":"https://api.github.com/users/santiagobasulto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santiagobasulto/subscriptions","organizations_url":"https://api.github.com/users/santiagobasulto/orgs","repos_url":"https://api.github.com/users/santiagobasulto/repos","events_url":"https://api.github.com/users/santiagobasulto/events{/privacy}","received_events_url":"https://api.github.com/users/santiagobasulto/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T20:16:58Z","updated_at":"2017-11-29T20:16:58Z","author_association":"CONTRIBUTOR","body":"The code is exactly right! There's no other way to do O(n) for this particular operation, as you must check EVERY possible element. The operation `item in new_list` is expensive for lists, so, in a situation with more elements it **might** make sense to keep a separate set (or similar data structure) to perform the `item in new_list` operation. A good idea might be a [bloom filter](https://en.wikipedia.org/wiki/Bloom_filter). This is a clear example of the tradeoff between computation efficiency and storage efficiency (CPU vs Memory)."}}
{"actor":{"display_login":"santiagobasulto"}}