The training set is full of code for these problems.
Put your query into Google and see how many thousands of answers appear.
Your tests are in the training set.
Put your query into Google and see how many thousands of answers appear.
Your tests are in the training set.