Added code for favorite sequence of hackerrank.