上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
摘要: Given two integers n and k, find how many different arrays consist of numbers from 1 to n such that there are exactly k inverse pairs. We define an in 阅读全文
posted @ 2017-12-02 02:46 jxr041100 阅读(149) 评论(0) 推荐(0) 编辑
摘要: The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 阅读全文
posted @ 2017-11-28 12:42 jxr041100 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than  阅读全文
posted @ 2017-11-27 14:40 jxr041100 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Write a function to generate the generalized abbreviations of a word. Example: Given word = "word", return the following list (order does not matter): 阅读全文
posted @ 2017-11-26 15:28 jxr041100 阅读(125) 评论(0) 推荐(0) 编辑
摘要: A string such as "word" contains the following abbreviations: ["word", "1ord", "w1rd", "wo1d", "wor1", "2rd", "w2d", "wo2", "1o1d", "1or1", "w1r1", "1 阅读全文
posted @ 2017-11-26 15:23 jxr041100 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example:Given 阅读全文
posted @ 2017-11-26 15:18 jxr041100 阅读(183) 评论(0) 推荐(0) 编辑
摘要: An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla 阅读全文
posted @ 2017-11-26 15:11 jxr041100 阅读(149) 评论(0) 推荐(0) 编辑
摘要: You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int 阅读全文
posted @ 2017-11-24 10:01 jxr041100 阅读(198) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree with n nodes, your task is to check if it's possible to partition the tree to two trees which have the equal sum of values after r 阅读全文
posted @ 2017-11-24 09:57 jxr041100 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. The integer B denotes that from any place (suppose th 阅读全文
posted @ 2017-11-24 09:54 jxr041100 阅读(164) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页