![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode OJ
坤哥玩csdn
这个作者很懒,什么都没留下…
展开
-
LeetCode || Median of Two Sorted Arrays
题目:Median of Two Sorted ArraysThere are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log转载 2015-06-01 11:02:13 · 508 阅读 · 0 评论 -
LeetCode || 3Sum
题目如下:Given an array S of n integers, are there elements a,b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements转载 2015-06-14 19:44:08 · 510 阅读 · 0 评论 -
LeetCode || Two Sum
Two SumTotal Accepted: 93815 Total Submissions: 532726Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should re转载 2015-05-27 18:42:12 · 515 阅读 · 0 评论 -
LeetCode || Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique permutations.By listing and labeling all of the permutations in order,We get the following sequence (ie, for n = 3):"123""132""213""231""312""原创 2015-07-06 21:10:39 · 646 阅读 · 0 评论 -
LeetCode || Set Matrix Zeroes
Set Matrix ZeroesTotal Accepted: 40253 Total Submissions: 128076Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use ext转载 2015-07-17 21:27:03 · 691 阅读 · 0 评论 -
LeetCode ||Count Primes
Count PrimesDescription:Count the number of prime numbers less than a non-negative number, n.题意:统计小于n数中质数的个数根据维基百科Sieve of Eratosthenes或者百度百科埃拉托色尼筛选法来求解范围内的质数的个数。具体方法:将n内的数放到数组中,假设所有小于n的数均是质数,首先排除1,2是质原创 2015-08-22 00:42:37 · 793 阅读 · 0 评论 -
用位运算实现四则运算之加减乘除
转自:http://www.cnblogs.com/dandingyy/archive/2012/10/29/2745570.html^: 按位异或;&:按位与; | :按位或计算机系统中,数值一律用补码来表示:因为补码可以使符号位和数值位统一处理,同时可以使减法按照加法来处理。对补码做简单介绍:数值编码分为原码,反码,补码,符号位均为0正1负。原码 -> 补码: 数值位取转载 2015-06-18 09:05:28 · 1194 阅读 · 0 评论