2014年3月10日

Substring with Concatenation of All Words

摘要: You are given a string,S, and a list of words,L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.For example, given:S:"barfoothefoobarman"L:["foo", " 阅读全文

posted @ 2014-03-10 19:46 pengyu2003 阅读(157) 评论(0) 推荐(0) 编辑

Merge k Sorted Lists

摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.学习并练习 priority_queue.priority_queue的几个重要函数 push pop top./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * };... 阅读全文

posted @ 2014-03-10 15:42 pengyu2003 阅读(110) 评论(0) 推荐(0) 编辑

导航