摘要: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a conca 阅读全文
posted @ 2017-03-17 16:11 aiterator 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目链接: + 题目大意: + 有一些木棍,木棍两端有不同的颜色; + 两个木棍能够排列到一块,当且仅当两个木棍相邻端点颜色一样; + 问这些木棍能否全部链接到一块; 解题思路: + 首先,可以将每一个颜色,看做是一个点; + 木棍就可以看做为两个颜色之间的一条边; + 然后就可以组成一个图; + 阅读全文
posted @ 2017-03-17 13:48 aiterator 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目链接: + 题目大意: + 一个NxN矩阵,有一些障碍在矩阵中; + 消除障碍,一次可以消除一行或者一列; + 问最小次数 解题思路: + 可以将每一行,每一列看做一个端点; + 障碍看做两个端点之间的边, 那么NxN矩阵就转化为了一个无向图。 + 最后只求最小点覆盖,即为答案 + 最小点覆盖 阅读全文
posted @ 2017-03-17 08:50 aiterator 阅读(102) 评论(0) 推荐(0) 编辑