https://leetcode.com/problems/contains-duplicate-ii/
Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] nums[j] and the difference between i and j is at most k.
这道题目源自…
https://leetcode.com/problems/power-of-two/
Given an integer, write a function to determine if it is a power of two.
数字 2^n 是大于0的,而且等于1左移n位得到的数字,所以2^n与2^n-1 相与运算得到0.
bool isPowerOfTwo(int n) {if(n < 0)…
简介2013 年起,为了评测现有的环境声音检测方法,电子与电气工程师学会音频和声学信号处理协会(Institute of Electrical and Electronics Engineers Audio and Acoustic Signal Process, IEEE AASP )开始举办声学场景和事件的检测与分类挑战赛(Detection…
https://leetcode.com/problems/number-of-1-bits/
Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).
For example, the 32-bit integer ’11’ has binary representation 0000000000000…