摘要:
嗯。。。用的加法,注意a为最大值 b为1或者-1,还有a为负数最小值就行 也可以用位运算 << 相当于 * 2呗 其他的可以用sum + sum <= abs(a) 来优化 class Solution { public: int divide(int a, int b) { long long A 阅读全文
摘要:
水题 n方即可 class Solution { public: string convert(string s, int numRows) { if (numRows == 1) return s; int len = s.length(); int cnt = 0; int str[1001][ 阅读全文
摘要:
好吧 我用的O(n)的 class Solution { public: double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) { int n = nums1.size(), m = nums2.size(); i 阅读全文