摘要: bool cmp (int i,int j) { return (i>j);} class Solution { public: int hIndex(vector& citations) { int count = 0; sort(citations.begin(),citations.end(),cmp); for(int i = ... 阅读全文
posted @ 2018-08-18 16:10 Lokianyu 阅读(209) 评论(0) 推荐(0)
摘要: A. Single Wildcard Pattern Matching 题目链接:A. Single Wildcard Pattern Matching 题意:给定两个字符串,第一个字符串至多含有一个*,然后可以把*替换成一个任意的字符串,求这两个字符串是否匹配。 思路:首先判断是否含有'*',没有 阅读全文
posted @ 2018-08-18 09:55 Lokianyu 阅读(89) 评论(0) 推荐(0)