We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. ...
A magical stringSconsists of only and and obeys the following rules: The stringSis magical because concatenating the number of contiguous occurrences of characters and generates the stringSitself. Th ...
2017-01-15 03:50 2 6416 推荐指数:
We are given two strings, A and B. A shift on A consists of taking string A and moving the leftmost character to the rightmost position. ...
Given an array of characters, compress it in-place. The length after compression must always be ...
A positive integer is *magical* if it is divisible by either A or B. Return the N-th magical number. Since the answer may be very large, return ...
Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Update ...
Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another ...
Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first ...
Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string ...
Given a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters between <b> and </b> tags ...