题目描述:
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.
Example ...
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.
Example ...
LeetCode 337. House Robber III
The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent ...
使用泛型的冒泡排序Java代码:
public class SortUtils {
public static <T extends Comparable<? super T>> void bubbleSort(T[] nums) {
int size = nums.length;
for (int k = 0; k < size; k++) {
for (int i = 0; i + k + 1 < size; i++) {
if (nums[i ...
LeetCode 336. Palindrome Pairs
Given a list of unique words. Find all pairs of indices (i, j)
in the given list, so that the concatenation of the two words, i.e. words[i] + words[j]
is a palindrome.
Example ...