A magical string S consists of only '1' and '2' and obeys the following rules: The string S is magical because ...
Given a stringS, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output any possible result. If not possible, return the e ...
2018-04-11 23:40 6 7182 推薦指數:
A magical string S consists of only '1' and '2' and obeys the following rules: The string S is magical because ...
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 ...
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 ...
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible ...
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid. We define ...
To some string S, we will perform some replacement operations that replace groups of letters with new ones (not necessarily the same size). Each ...
Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's ...