随笔分类 - 小程序
摘要:#define max(a, b) ((a) > (b) ? (a) : (b)) static char* reverse(char *str) { char *l, *r, c; for (l = str, r = str + strlen(str) - 1; l < r; l++, r--) { c = *l; *l = *r; ...
阅读全文
摘要:假设有一个字符串数组,每一个字符都是一个数字(1-9),找到其中的最大递增数,递增数是指相邻的数位从小到大排列的数字,如:28953456323,递增数有:289,3456,23,那么最大的递增数为3456。
阅读全文
摘要:链表检测环 链表是否交叉 两个链表第一个公共节点
阅读全文
摘要:输入“I am a student”输出“student a am I”
阅读全文
摘要:https://leetcode.com/problems/same-tree/
阅读全文
摘要:/* * Zip a string. For example, "aaabcc" => "3ab2c". * You should directly update the input string. */ void strzip(char *str) { int count; char *p, *idx, c; for (count = 0, p = idx = str...
阅读全文
摘要:Leetcode上 majority element这题是 有 时间O(N), 空间O(1)的解的. https://leetcode.com/problems/majority-element/ 用hash table来解则为 时间O(N), 空间O(N). 如果是Java里 用HashMap很方
阅读全文

浙公网安备 33010602011771号