#数组和字符串
该标签下的全部文章。
Rotate String
给定一个字符串,要求把字符串前面的若干个字符移动到字符串的尾部,如把字符串 abcdef前面的2个字符a和b移动到字符串的尾部,使得原字符串变成字符串cdefab。
Shortest Palindrome
Given a string S, you are allowed to convert it to a palindrome by adding characters in front of it.
Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.
Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.