摘要:
原博客地址:http://blog.csdn.net/larry233 =============================================我是搬家的分割线========================================================= 和大多 阅读全文
摘要:
描述 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, 阅读全文
摘要:
描述 In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking asc 阅读全文
摘要:
描述 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For e 阅读全文
摘要:
描述 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one 阅读全文
摘要:
描述 You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' 阅读全文
摘要:
描述 Remove all elements from a linked list of integers that have value val. Example Given: 1 2 6 3 4 5 6, val = 6 Return: 1 2 3 4 5 分析 先构造一个链表结点 dummyH 阅读全文
摘要:
描述 Reverse a singly linked list. 分析 一开始写的时候总感觉没抓到要点,然后想起上数据结构课的教材上有这道题,翻开书一看完就回忆起来了,感觉解法挺巧妙的,不比讨论区的答案差。 这道题是放在链栈后面的,用的也是链栈的思想: 依次将原来栈中的元素出栈,并插入到初值为空的另 阅读全文
摘要:
描述 Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 分析 这道题没做出来。。 逛了评论区才写出来的,代码写得很简洁 http 阅读全文
摘要:
描述 Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order 阅读全文
摘要:
描述 Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. 分析 先构造了一个杨辉三角,然后返回这个杨辉三角的最后一组值,没超时就万事大吉了 阅读全文