Interview Algorithms in TypeScript factorial fibonacci longest word index of two sum first duplicate binary search first non repeating character matching parenthesis longest palindromic substring reversing a linked list depth first search breadth first search pascal triangle sieve of eratosthenes