Return the first and last character of a string, concatenated together. If there is only one character in the string, the function should give that character back twice since it is both the first and last character of the string.
Example:
stringfirstandlast('boring example') = 'be'
Well, I guess my understanding that string is defined using (" " , i.e. double quotations) is incorrect. I thought class string was formally distinguished from char (defined using ' ', i.e. single quotes). I should have looked at the test-suite.
Nice!
Only need:
out = x([1 end])
This is legal even if length(x) == 1, because in that case, x(1) == x(end)
that is it
Get the area codes from a list of phone numbers
417 Solvers
451 Solvers
273 Solvers
299 Solvers
Find a subset that divides the vector into equal halves
289 Solvers