Given two strings, a and b, create a bigger string made of the first char of a, the first char of b, the second char of a, the second char of b, and so on. Any…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given a string and an int n, return a string made of n repetitions of the last n characters of the string. You may assume that n is between 0 and the length of…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given a string and an int n, return a string made of the first n characters of the string, followed by the first n-1 characters of the string, and so on. You…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given a string, consider the prefix string made of the first N chars of the string. Does that prefix string appear somewhere else in the string? Assume that the…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given a string, does "xyz" appear in the middle of the string? To define middle, we'll say that the number of chars to the left and right of the "xyz" must…
Sign up now. It's free!
See the full question with its answer and worked solution.
A sandwich is two pieces of bread with something in between. Return the string that is between the first and last appearance of "bread" in the given string, or…
Sign up now. It's free!
See the full question with its answer and worked solution.
Given a string, compute a new string by moving the first char to come after the next two chars, so "abc" yields "bca". Repeat this process for each subsequent…
Sign up now. It's free!
See the full question with its answer and worked solution.
Look for patterns like "zip" and "zap" in the string -- length-3, starting with 'z' and ending with 'p'. Return a string where for all such words, the middle…
Sign up now. It's free!
See the full question with its answer and worked solution.
AP® and Advanced Placement® are registered trademarks of the College Board, which is not affiliated with, and does not endorse, Verityprep. Names are used for identification purposes only.