Category: c / c++
Given n items with size A (i from 0 to n – 1), an integer m denotes the size of a backpack. How full you can fill this backpack? …
Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it in O(n) time and O(1) …
A point is chosen randomly in a square. 4 lines are drawn to connect this point with the 4 vertices of this square, such that 4 triangles are formed. …
The Bitcoin hard-forked this Month (1 Aug 2017), which is the biggest great news in the bitcoin world. The fork is the operation for process to duplicate the code …
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. For example, given two integers x=1 and y=4, the hamming distance …