摘要: Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever A[i]  阅读全文
posted @ 2018-10-14 21:29 hopskin1 阅读(510) 评论(0) 推荐(1) 编辑
摘要: Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example, given a 3-ary tree: 阅读全文
posted @ 2018-10-14 20:50 hopskin1 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 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 positi 阅读全文
posted @ 2018-10-14 20:26 hopskin1 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 按序记录每棵树叶子节点。比较是否一致。 前序,中序,后序都可以。 Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequ 阅读全文
posted @ 2018-10-14 20:04 hopskin1 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Example 1: Input: ["a","b","c","a","c","c"]Output: 3Explanation: 3 groups ["a","a"], ["b"], ["c","c","c"]Example 2: Input: ["aa","bb","ab","ba&qu 阅读全文
posted @ 2018-10-14 19:43 hopskin1 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le 阅读全文
posted @ 2018-10-14 19:17 hopskin1 阅读(164) 评论(0) 推荐(0) 编辑