摘要:
题目要求 Given a binary array, find the maximum number of consecutive 1s in this array. 题目分析及思路 给定一个01数组,要求找到这个数组中连续1的最大长度。可以考虑0的位置,结合数组切片,循环进行。要记得把最后数组的长 阅读全文
摘要:
题目要求 An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i <= j, A[i] <= A[ 阅读全文
摘要:
题目要求 Design a HashMap without using any built-in hash table libraries. To be specific, your design should include these functions: put(key, value) : I 阅读全文
摘要:
题目要求 We want to use quad trees to store an N x N boolean grid. Each cell in the grid can only be true or false. The root node represents the whole gri 阅读全文
摘要:
题目要求 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points. 题目分析及思路 给定一个平面上的一组点,要求 阅读全文
摘要:
题目要求 You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 阅读全文
摘要:
题目要求 Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on 阅读全文
摘要:
题目要求 Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible 阅读全文
摘要:
题目要求 On a N * N grid, we place some 1 * 1 * 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of grid cell (i, j). Return 阅读全文
摘要:
题目要求 Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and all letters reverse their p 阅读全文