自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 1154. Day of the Year

Codeint dayOfYear(char * date){ int year, month, day, answer = 0; year = (date[0]-48) * 1000 + (date[1]-48) * 100 + (date[2]-48) * 10 + (date[3]-48); month = (date[5]-48) * 10 + (date[6]-48); day = (date[8]-48) * 10 + (date[9]-48); int

2020-06-02 00:22:54 196

原创 1431. 拥有最多糖果的孩子

code/** * Note: The returned array must be malloced, assume caller calls free(). */bool* kidsWithCandies(int* candies, int candiesSize, int extraCandies, int* returnSize){ bool *answer = (bool*)malloc(sizeof(bool) * candiesSize); int max_candy

2020-06-01 23:19:27 118

原创 744. 寻找比目标字母大的最小字母

Codechar nextGreatestLetter(char* letters, int lettersSize, char target){ char answer; for(int i=0;i<lettersSize;i++) { if(letters[i]>target) { answer = letters[i]; return answer; } }

2020-05-31 21:22:27 159

原创 1291. 顺次数 我们定义「顺次数」为:每一位上的数字都比前一位上的数字大 1 的整数。 请你返回由 [low, high] 范围内所有顺次数组成的 有序 列表(从小到大排序)

代码/** * Note: The returned array must be malloced, assume caller calls free(). */int* sequentialDigits(int low, int high, int* returnSize){ int possible[36] = {12, 23, 34, 45, 56, 67, 78, 89, 123, 234, 345, 456, 567, 678, 789,

2020-05-29 17:34:46 469

原创 977.有序数组的平方 给定一个按非递减顺序排序的整数数组 A,返回每个数字的平方组成的新数组,要求也按非递减顺序排序。

代码/** * Note: The returned array must be malloced, assume caller calls free(). */int* sortedSquares(int* A, int ASize, int* returnSize){ int bucket[10001]; memset(bucket, 0, sizeof(int)*10001); for(int i=0;i<ASize;i++) { if(A

2020-05-28 20:25:51 704

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除