开学后忙的焦头烂额(懒得很),正式开始刷leecode的题目了. 想了想c语言是最最基础的语言,虽然有很多其他语言很简单,有更多的函数可以用,但c语言能煅炼下自己的思考能力.python则是最流行的语言. 做题用的是 xcode的 leecode插件 非常的方便.顺序从简单到难.开始. [1] 两数之和 * * https://leetcode-cn.com/problems/two-sum/description/ * * algorithms * Easy (44.20%) * Total…
/* * @lc app=leetcode.cn id=387 lang=c * * [387] 字符串中的第一个唯一字符 * * https://leetcode-cn.com/problems/first-unique-character-in-a-string/description/ * * algorithms * Easy (36.55%) * Total Accepted: 23.7K * Total Submissions: 64.7K * Testcase Example: '…
/* * @lc app=leetcode.cn id=28 lang=c * * [28] 实现strStr() * * https://leetcode-cn.com/problems/implement-strstr/description/ * * algorithms * Easy (37.86%) * Total Accepted: 38.6K * Total Submissions: 102K * Testcase Example: '"hello"\n"ll&…
/* * @lc app=leetcode.cn id=7 lang=c * * [7] 整数反转 * * https://leetcode-cn.com/problems/reverse-integer/description/ * * algorithms * Easy (31.36%) * Total Accepted: 77.7K * Total Submissions: 247.8K * Testcase Example: '123' * * 给出一个 32 位的有符号整数,你需要将这…
/* * @lc app=leetcode.cn id=434 lang=c * * [434] 字符串中的单词数 * * https://leetcode-cn.com/problems/number-of-segments-in-a-string/description/ * * algorithms * Easy (29.13%) * Total Accepted: 4.2K * Total Submissions: 14.2K * Testcase Example: '"Hello, m…
/* * @lc app=leetcode.cn id=326 lang=c * * [326] 3的幂 * * https://leetcode-cn.com/problems/power-of-three/description/ * * algorithms * Easy (42.85%) * Total Accepted: 14.2K * Total Submissions: 33.1K * Testcase Example: '27' * * 给定一个整数,写一个函数来判断它是否是 3…
/* * @lc app=leetcode.cn id=263 lang=c * * [263] 丑数 * * https://leetcode-cn.com/problems/ugly-number/description/ * * algorithms * Easy (44.82%) * Total Accepted: 7K * Total Submissions: 15.7K * Testcase Example: '6' * * 编写一个程序判断给定的数是否为丑数. * * 丑数就是只包…
/* * @lc app=leetcode.cn id=383 lang=c * * [383] 赎金信 * * https://leetcode-cn.com/problems/ransom-note/description/ * * algorithms * Easy (44.98%) * Total Accepted: 5K * Total Submissions: 11.1K * Testcase Example: '"a"\n"b"' * * 给定一个赎金…
/* * @lc app=leetcode.cn id=371 lang=c * * [371] 两整数之和 * * https://leetcode-cn.com/problems/sum-of-two-integers/description/ * * algorithms * Easy (55.04%) * Total Accepted: 8.1K * Total Submissions: 14.8K * Testcase Example: '1\n2' * * 不使用运算符 + 和 - …
/* * @lc app=leetcode.cn id=349 lang=c * * [349] 两个数组的交集 * * https://leetcode-cn.com/problems/intersection-of-two-arrays/description/ * * algorithms * Easy (60.49%) * Total Accepted: 15.1K * Total Submissions: 25K * Testcase Example: '[1,2,2,1]\n[2,2…