These are some of the codes which will be helpful for beginners. You can see more codes for popular coding problems like these in my blog