LeetCode之First Unique Character in a String

1、题目Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode" return ...

LeetCode之Reverse String II

1、题目Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If ther...

LeetCode之Reverse String

1、题目:Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".2、代码实现:代码实现1: public stat...

LeetCode 394:字符串解码 Decode String

题目: 给定一个经过编码的字符串,返回它解码后的字符串。Given an encoded string, return its decoded string. 编码规则为: k[encoded_string],表示其中方括号内部的 encoded_string 正好重复 k 次。注意 k 保证为正整...

LeetCode 151:给定一个字符串,逐个翻转字符串中的每个单词 Reverse Words in a String

公众号:爱写bug(ID:icodebugs) 翻转字符串里的单词 Given an input string, reverse the string word by word. 示例 1: 输入: "the sky is blue" 输出: "blue is sky the" 示例 2: 输入: ...

Leetcode 344:Reverse String 反转字符串(python、java)

Leetcode 344:Reverse String 反转字符串 公众号:爱写bugWrite a function that reverses a string. The input string is given as an array of characters char[]. Do not...

[LeetCode] Reverse String 翻转字符串

Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 这道题没什么难度,直接从两头往中间走,同时交换两边的字...

[LeetCode] Decode String 解码字符串

Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the squar...

[LeetCode] Reverse String II 翻转字符串之二

Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar...

[LeetCode] Permutation in String 字符串中的全排列

Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one o...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。