#string
Shlyan
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LeetCode][String] 151. Reverse Words in a String
Problems: https://leetcode.com/problems/reverse-words-in-a-string/Solution:class Solution { public String reverseWords(String s) { if (s == null || s.length() == 0) { return ...原创 2019-10-03 20:26:41 · 96 阅读 · 0 评论 -
[LeetCode][String] 344. Reverse String
Problems https://leetcode.com/problems/reverse-string/Solution:class Solution { public void reverseString(char[] s) { int i = 0; int j = s.length -1; while (i < j) { ...原创 2019-10-03 19:32:35 · 95 阅读 · 0 评论 -
[LeetCode][String] 383. Ransom Note
Problem: https://leetcode.com/problems/ransom-note/Solution:class Solution { public boolean canConstruct(String ransomNote, String magazine) { HashMap<Character, Integer> count = n...原创 2019-10-03 09:37:30 · 197 阅读 · 0 评论 -
[Leetcode][String] 345. Reverse Vowels of a String
Problem: https://leetcode.com/problems/reverse-vowels-of-a-string/Solution:class Solution { public String reverseVowels(String s) { int i = 0; int j = s.length() - 1; cha...原创 2019-10-04 04:09:15 · 108 阅读 · 0 评论 -
[Leetcode][String] 205. Isomorphic Strings
Problems: https://leetcode.com/problems/isomorphic-strings/Solution1:粗糙:class Solution { public boolean isIsomorphic(String s, String t) { if (s.length() != t.length()) { re...原创 2019-10-04 04:29:51 · 111 阅读 · 0 评论 -
[Leetcode] 125. Valid Palindrome
Problems:https://leetcode.com/problems/valid-palindrome/Solution:class Solution { public boolean isPalindrome(String s) { // 将字符小写化 String ls = s.toLowerCase(); // 删除不是数字/字...原创 2019-10-06 09:09:16 · 96 阅读 · 0 评论 -
[LeetCode] 680. Valid Palindrome II
Problems: https://leetcode.com/problems/valid-palindrome-ii/Solution:若不回文s [ i : j ],比较s [ i+1 : j ]和s [ i : j+1 ]class Solution { public boolean isPalindrome(String s) { for (int i = 0...原创 2019-10-06 22:26:17 · 97 阅读 · 0 评论
分享