solve 1.5 in O(n) time and put .gitignore file