随笔分类 - Array
摘要:Cosine similarity is a measure of similarity between two vectors of an inner product space that measures the cosine of the angle between them. The cos
阅读全文
摘要:Intersection of Two Arrays Given two arrays, write a function to compute their intersection. Example Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], retur
阅读全文
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist
阅读全文
摘要:Given an array with positive and negative integers. Re-range it to interleaving with positive and negative integers. Note: You are not necessary to ke
阅读全文
摘要:Majority Number Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it. Example Gi
阅读全文
摘要:Given an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given number target. If the arra
阅读全文
摘要:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: 转载请注明出处: cnbl
阅读全文
摘要:Subsets I Given a set of distinct integers, return all possible subsets. Notice Elements in a subset must be in non-descending order. The solution set
阅读全文

浙公网安备 33010602011771号