摘要: Given a string, determine if a permutation of the string could form a palindrome. For example,"code" -> False, "aab" -> True, "carerac" -> True. Hint: 阅读全文
posted @ 2018-03-23 11:46 轻风舞动 阅读(555) 评论(0) 推荐(0) 编辑
摘要: Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form 阅读全文
posted @ 2018-03-23 11:44 轻风舞动 阅读(847) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
posted @ 2018-03-23 09:29 轻风舞动 阅读(488) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文
posted @ 2018-03-23 09:03 轻风舞动 阅读(515) 评论(0) 推荐(0) 编辑
摘要: Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2018-03-23 08:34 轻风舞动 阅读(569) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted i 阅读全文
posted @ 2018-03-23 08:19 轻风舞动 阅读(588) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2018-03-23 08:06 轻风舞动 阅读(515) 评论(0) 推荐(0) 编辑
摘要: There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor 阅读全文
posted @ 2018-03-23 07:07 轻风舞动 阅读(357) 评论(0) 推荐(0) 编辑
摘要: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2018-03-23 06:36 轻风舞动 阅读(747) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 给一个二叉树,返回所有根到叶节点的路径。 Jav 阅读全文
posted @ 2018-03-23 04:26 轻风舞动 阅读(402) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2018-03-23 04:26 轻风舞动 阅读(452) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: Note: 125. Valid P 阅读全文
posted @ 2018-03-23 03:24 轻风舞动 阅读(420) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 给一个链表,判断是否为回文。 如果是字符串就比较容易判断。但链表不能 阅读全文
posted @ 2018-03-23 02:59 轻风舞动 阅读(808) 评论(0) 推荐(0) 编辑