leetcode
MarchZhen
这个作者很懒,什么都没留下…
展开
-
Array Partition I
题目大意:给定一个长度为2n的数组,将它分为n个小组,每组两个元素。求出每组中最小值和,返回其中最大的和sum。Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum原创 2017-05-11 09:43:32 · 201 阅读 · 0 评论 -
Distribute Candies
题目大意:每个数字代表一种糖果。共偶数个糖果,平分给弟弟妹妹,如何让妹妹获得最多种类的糖果?Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the cor原创 2017-05-11 09:44:41 · 206 阅读 · 0 评论