Concatenate First and Last Characters
STRING
Problem
Given a non-empty string s
, return a new string consisting of the first and last characters of s
.
Examples
concatFirstLastChar("abc"); // returns "ac" concatFirstLastChar("test"); // returns "tt" concatFirstLastChar("hello"); // returns "ho" concatFirstLastChar("z"); // returns "zz"
Loading...