You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots. Given an integer array flowerbed containing 0’s and 1’s, where 0 means empty and 1 means not empty, and an integer n…
Given a string s, return true if the s can be palindrome after deleting at most one character from it.
思路 用头尾指针遍历原字符串,但碰到所指不相同时,需要退出循环记录此书指针的位置。分别去除两个指针上的内容,查看删除一个字符…
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the…