摘要: Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example 1: Input: 阅读全文
posted @ 2018-10-07 19:36 C`Moriarty 阅读(186) 评论(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-10-07 19:23 C`Moriarty 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2018-09-26 23:33 C`Moriarty 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. 题意:找一个链表中是否含有环,如果没有则返回null,如果有则返回环的起点 我的解法,投机取巧了,我改了va 阅读全文
posted @ 2018-09-26 23:24 C`Moriarty 阅读(94) 评论(0) 推荐(0) 编辑
摘要: S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to per 阅读全文
posted @ 2018-09-26 08:55 C`Moriarty 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Example 2: Note: The length of the giv 阅读全文
posted @ 2018-09-25 23:28 C`Moriarty 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 204. Count Primes 204. Count Primes 204. Count Primes 204. Count Primes Count the number of prime numbers less than a non-negative number, n. Example: 阅读全文
posted @ 2018-09-25 23:26 C`Moriarty 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Input: 2 Output: 91 Explanation: The answer shoul 阅读全文
posted @ 2018-09-24 23:23 C`Moriarty 阅读(132) 评论(0) 推荐(0) 编辑
摘要: There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next r 阅读全文
posted @ 2018-09-19 21:01 C`Moriarty 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ 阅读全文
posted @ 2018-09-17 21:18 C`Moriarty 阅读(128) 评论(0) 推荐(0) 编辑
/* 鼠标点击求赞文字特效 */ /*鼠标跟随效果*/