摘要:
题为:股票最佳买卖时机Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to co... 阅读全文
摘要:
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets i... 阅读全文
摘要:
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in... 阅读全文
摘要:
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.先查了一下单词,意思是单词重排, abc ... 阅读全文
摘要:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes c... 阅读全文
摘要:
Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".思路: 对齐, 计算当前位和进位; ... 阅读全文
摘要:
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the... 阅读全文
摘要:
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which g... 阅读全文