摘要: 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 in the array whic 阅读全文
posted @ 2017-11-21 15:55 binryang 阅读(106) 评论(0) 推荐(0)
摘要: 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 three integers. 阅读全文
posted @ 2017-11-21 14:50 binryang 阅读(81) 评论(0) 推荐(0)
摘要: The "Hamming distance" between two integers is the number of positions at which the corresponding bits are different. Given two integers and , calcula 阅读全文
posted @ 2017-10-26 17:02 binryang 阅读(148) 评论(0) 推荐(0)
摘要: 反射允许你在运行时分析任意的对象。如果对象是泛型类的实例,关于泛型类型参数则得不到太多信息,因为它们会被擦除。利用反射可以获得泛型类的信息。 阅读全文
posted @ 2017-10-23 21:13 binryang 阅读(203) 评论(0) 推荐(0)
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example, Given , you should return the list as . Your algorithm should use 阅读全文
posted @ 2017-10-20 13:16 binryang 阅读(96) 评论(0) 推荐(0)
摘要: The count and say sequence is the sequence of integers with the first five terms as following: is read off as or . is read off as or . is read off as 阅读全文
posted @ 2017-10-16 16:43 binryang 阅读(113) 评论(0) 推荐(0)
摘要: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2017-10-16 14:46 binryang 阅读(82) 评论(0) 推荐(0)
摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or 1 if needle is not part of haystack. public int strStr(String 阅读全文
posted @ 2017-10-11 13:07 binryang 阅读(63) 评论(0) 推荐(0)
摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-10-11 12:26 binryang 阅读(64) 评论(0) 推荐(0)
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2017-09-28 12:13 binryang 阅读(69) 评论(0) 推荐(0)