摘要:
[抄题]: Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: [暴力解法]: 时间分析 阅读全文
摘要:
[抄题]: 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 3 阅读全文
摘要:
[抄题]: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, 阅读全文
摘要:
[抄题]: Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime c 阅读全文
摘要:
[抄题]: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adj 阅读全文
摘要:
[抄题]: There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a 阅读全文
摘要:
[抄题]: On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two st 阅读全文
摘要:
Immutable [抄题]: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: [暴力解法]: 时间分析:n 空间分析:n [ 阅读全文
摘要:
[抄题]: Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printe 阅读全文
摘要:
[抄题]: Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example, [暴力解法]: 时间分析: 空间分 阅读全文