摘要: 题目如下: Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land) A move consists of walking from one land square 4-directionally t 阅读全文
posted @ 2019-04-01 15:45 seyjs 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 题目如下: We are given a linked list with head as the first node. Let's number the nodes in the list: node_1, node_2, node_3, ... etc. Each node may have 阅读全文
posted @ 2019-04-01 15:42 seyjs 阅读(615) 评论(0) 推荐(0) 编辑
摘要: 题目如下: Given a number N, return a string consisting of "0"s and "1"s that represents its value in base -2 (negative two). The returned string must have 阅读全文
posted @ 2019-04-01 10:47 seyjs 阅读(539) 评论(0) 推荐(0) 编辑
摘要: 题目如下: Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to le 阅读全文
posted @ 2019-04-01 10:28 seyjs 阅读(453) 评论(0) 推荐(0) 编辑
摘要: 题目如下: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null 阅读全文
posted @ 2019-04-01 10:24 seyjs 阅读(102) 评论(0) 推荐(0) 编辑