1. (20 pt) Implement a function char *head_tail_trim(char *s1, int h, int t);
which copies the characters (except the first h character and last t characters) from the given
string s1 into a dynamically created new string and returns the pointer to this new string.
If t+h is greater than the length of the string, or h or t is less than 0, return NULL
For example:
After s = head_tail_trim("ABCDEFG", 2, 3);
After s = head_tail_trim("ABCDEFG", 0, 3);
After s = head_tail_trim("ABCDEFG", 3, 4);
After s = head_tail_trim("ABCDEFG", 5, 4);
After s = head_tail_trim("ABCDEFG", -2, 3);
s should be pointing to "CD"
s should be pointing to "ABCD"
s should be pointing to ""
s should be NULL.
s should be NULL.
Suppose standard libraries are included. So, standard library functions can be used if needed.
char *head_tail_trim(char *s1, int h, int t)
{
/* you can use either pointer or array notation */