Julia spent over 1 hour to work on this question. So, her first two practices using facebook code lab:
1. Use recursive function - stack overflow issue
https://gist.github.com/jianminchen/b31347aed2fe140384215156004790a5
2. Use iteration solution, but run time performance needs to improve (July15, 2016)/ unreachable code, showing different error messages on July 16, 2016
https://gist.github.com/jianminchen/0318844f35723d6e28d9a90092b2a85c
Then, Julia spent 20 minutes to think if she should use binary search to expedite the search not distinct node - extra array to help, but then, she checked the code lab.
Recall her previous blog on the linked list:
http://juliachencoding.blogspot.ca/2016/05/hackerrank-delete-duplicate-value-nodes.html
(Pass HackerRank test, but fail facebook code lab test? double check)
https://gist.github.com/jianminchen/9013539e71764a018f3745c514da9d91
Her favorite solution: (Pass facebook code lab test)
https://gist.github.com/jianminchen/a13738b4ab32decb8601f29777172209
Julia likes to talk about the issues of her practice on July 16, 2016:
No comments:
Post a Comment