随笔分类 -  c++

摘要:BF的生日快到了,这一次,小东决定为BF送一份特别的生日礼物为其庆生。作为高智商中的佼佼者,BF在国外求学,因此小东无法与之一起庆生。小东计划送一个生日卡片,并通过特别的包装让BF永远难忘。她决定把卡片套装在一系列的信封A = {a1, a2, ..., an}中。小东已经从商店中购买了很多的信封, 阅读全文
posted @ 2017-04-07 10:30 tacia 阅读(747) 评论(0) 推荐(0)
摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2017-01-24 19:35 tacia 阅读(168) 评论(0) 推荐(0)
摘要:You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2017-01-16 18:51 tacia 阅读(354) 评论(0) 推荐(0)
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2017-01-16 16:06 tacia 阅读(214) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-01-16 14:36 tacia 阅读(214) 评论(0) 推荐(0)