I'm supposed to write a function that receives a string and a number X as arguments, allocates a 2nd string of minimum length and copies first X characters of 1st string to the 2nd string and returns the 2nd string.
What would be the correct code for that?