Tray.ai Interview Question

Implement the getElementsByTagName function