This belongs to a series of posts about CodeFights: Arcade. If you don't know CodeFights then I strongly suggest you sign up to the site (it's free) and start battling and playing arcade mode to improve your coding skills. It's fun and it works your brain! Want to codefight?
If you haven't solved them then you shouldn't read on so that you can solve them on your own, that's how you improve.
Let's get started with Intro Gates.