• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






乘风有时

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

随笔分类 -  字符串

 
[LeetCode]Reverse String
摘要:题目:Reverse String Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 题意:逆置字符串 思 阅读全文
posted @ 2017-08-12 17:07 乘风有时 阅读(325) 评论(0) 推荐(1)
[LeetCode]Palindrome Pairs
摘要:题目:Palindrome Pairs Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two wo 阅读全文
posted @ 2017-08-10 22:51 乘风有时 阅读(187) 评论(0) 推荐(0)
[LeetCode]Implement Trie (Prefix Tree)
摘要:题目:Implement Trie (Prefix Tree) 实现字典树。 什么是字典树? Trie树,又叫字典树、前缀树(Prefix Tree)、单词查找树 或 键树,是一种多叉树结构。如下图: 上图是一棵Trie树,表示了关键字集合{“a”, “to”, “tea”, “ted”, “ten 阅读全文
posted @ 2017-08-08 10:49 乘风有时 阅读(238) 评论(0) 推荐(0)
[LeetCode]Integer to English Words
摘要:题目:Integer to English Words Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. For 阅读全文
posted @ 2017-05-07 19:42 乘风有时 阅读(161) 评论(0) 推荐(0)
[LeetCode]Basic Calculator
摘要:题目:Basic Calculator 给定一个合法的运算表达式,该表达式中只包含数字、'+'、'-'、' '、'('、')'。 思路: 简单思考不用看成加减两种运算,直接看成加法,只不过由正负; 如何处理括号呢?因为只看成加法,括号会影响的是数值的正负,那么通过去括号运算法则来修改当前值的正负就可 阅读全文
posted @ 2017-05-04 22:20 乘风有时 阅读(211) 评论(0) 推荐(0)
[LeetCode]Shortest Palindrome
摘要:题目:Shortest Palindrome 给定字符串,在前面增加最少字符使其组成回文字符串。 思想: 只要找到从字符串头部开始的最长回文子串,就能将剩下的字符串逆置后拼接到前面而得到最短的回文字符串。 /**判断字符串是回文的**/ bool isPalindrome(string s){ if 阅读全文
posted @ 2017-05-02 17:43 乘风有时 阅读(157) 评论(0) 推荐(0)
[LeetCode]Isomorphic Strings
摘要:题目:Isomorphic Strings 给定两个字符串(长度相等),判断它们是否同构;同构:两个字符串的字母对应位置是否能够一一对应。 For example,Given "egg", "add", return true. Given "foo", "bar", return false. G 阅读全文
posted @ 2017-04-30 21:59 乘风有时 阅读(162) 评论(0) 推荐(0)