Algorithm · Capital One · Easy
You are given a string s. Construct a new string by picking characters in the following order: the leftmost unused character, then the rightmost unused character, then the next leftmost, then the next rightmost, and so on, until every character has been taken exactly once. If the length of s is odd, the middle character – the one that becomes leftmost and rightmost simultaneously – must be placed at the very end of the constructed string. Example 1: Explanation: Take 'a'…
Checking your access…