摘要:
异或操作可以将不同的位,置为1,然后再统计出1的个数就可以计算出不同位数的个数。 C++ include using namespace std; int main() { int a, b; cin a b; int c = a ^ b; int num = 0; while (c) { num+ 阅读全文
摘要:
Question Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return 阅读全文
摘要:
Question Follow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run time complexity? How and why? 阅读全文
摘要:
Question 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] 阅读全文
摘要:
Question Given a positive integer n and you can do operations as follow: If n is even, replace n with n/2. If n is odd, you can replace n with either 阅读全文