上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 77 下一页
摘要: [抄题]: 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 e 阅读全文
posted @ 2018-08-01 21:45 苗妙苗 阅读(148) 评论(0) 推荐(0)
摘要: [抄题]: Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0. You may 阅读全文
posted @ 2018-08-01 16:57 苗妙苗 阅读(170) 评论(0) 推荐(0)
摘要: [抄题]: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes 阅读全文
posted @ 2018-08-01 15:37 苗妙苗 阅读(178) 评论(0) 推荐(0)
摘要: [抄题]: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given a 阅读全文
posted @ 2018-08-01 11:30 苗妙苗 阅读(131) 评论(0) 推荐(0)
摘要: [抄题]: Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You 阅读全文
posted @ 2018-07-31 18:38 苗妙苗 阅读(211) 评论(0) 推荐(0)
摘要: [抄题]: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Example 2: [暴力解法]: 时间分析: 空间分 阅读全文
posted @ 2018-07-31 17:25 苗妙苗 阅读(140) 评论(0) 推荐(0)
摘要: [抄题]: Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You m 阅读全文
posted @ 2018-07-31 16:38 苗妙苗 阅读(131) 评论(0) 推荐(0)
摘要: [抄题]: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 总算自己写出一道题来了。 [英文数据结构或算法,为什么不用别的数据结构或算法]: [一句话思路]: 总有case过不了,可以稍微调试一下,起 阅读全文
posted @ 2018-07-31 16:19 苗妙苗 阅读(120) 评论(0) 推荐(0)
摘要: [抄题]: Given an input string, reverse the string word by word. Example: [暴力解法]: 时间分析: 空间分析: [优化后]: 时间分析: 空间分析: [奇葩输出条件]: [奇葩corner case]: [思维问题]: 打碎成数组 阅读全文
posted @ 2018-07-31 14:52 苗妙苗 阅读(302) 评论(0) 推荐(0)
摘要: [抄题]: Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[ 阅读全文
posted @ 2018-07-31 10:06 苗妙苗 阅读(188) 评论(0) 推荐(0)
上一页 1 ··· 39 40 41 42 43 44 45 46 47 ··· 77 下一页