摘要:
Suppose 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 - they
阅读全文
posted @ 2019-05-04 06:20
程序媛詹妮弗
阅读(252)
推荐(0)
摘要:
Implement a data structure supporting the following operations: Challenge: Perform all these in O(1) time complexity. 题意: 设计一个类似hash map的计数器,但要提供最大值对应
阅读全文
posted @ 2019-04-26 04:50
程序媛詹妮弗
阅读(257)
推荐(0)
摘要:
Given an array of words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justif
阅读全文
posted @ 2019-04-25 22:26
程序媛詹妮弗
阅读(178)
推荐(0)
摘要:
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Example 2: NOTE: input types have been
阅读全文
posted @ 2019-04-25 21:58
程序媛詹妮弗
阅读(311)
推荐(0)
摘要:
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target. Note: Given target value is a floati
阅读全文
posted @ 2019-04-25 13:40
程序媛詹妮弗
阅读(194)
推荐(0)
摘要:
1 [leetcode]243. Shortest Word Distance最短单词距离 Two Pointers 2 [leetcode]244. Shortest Word Distance II最短单词距离(允许连环call) HashMap+Merge Sort 3 [leetcode]2
阅读全文
posted @ 2019-04-25 05:56
程序媛詹妮弗
阅读(438)
推荐(0)
摘要:
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant d
阅读全文
posted @ 2019-04-23 08:02
程序媛詹妮弗
阅读(135)
推荐(0)
摘要:
Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Example 2: 题意: 给定一个链表, 循环移位k次。
阅读全文
posted @ 2019-04-23 07:58
程序媛詹妮弗
阅读(202)
推荐(0)
摘要:
判断String是否为palindrome:Two Pointers(left & right) 同时边扫边check 当前两边的char是否相同 code 判断number是否为palindrome:先reverse original number 变为reversed number ,再判断 o
阅读全文
posted @ 2019-04-20 07:58
程序媛詹妮弗
阅读(328)
推荐(0)
摘要:
StringBuilder objects are like String objects, except that they can be modified. Internally, these objects are treated like variable-length arrays tha
阅读全文
posted @ 2019-04-20 07:04
程序媛詹妮弗
阅读(366)
推荐(0)