小红拿到了一个仅由"red"组成的字符串,她希望你将所有的'r'变成'e','e'变成'd','d'变成'r'后,返回这个字符串。你能帮帮她吗?请注意,这些变化是同时进行的。 字符串长度不超过
示例1
输入
"rredd"
输出
"eedrr"
加载中...
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ public String change (String mystr) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ string change(string mystr) { // write code here } };
#coding:utf-8 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param mystr string字符串 # @return string字符串 # class Solution: def change(self , mystr ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ public string change (string mystr) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ function change( mystr ) { // write code here } module.exports = { change : change };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param mystr string字符串 # @return string字符串 # class Solution: def change(self , mystr: str) -> str: # write code here
package main import "fmt" /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ func change( mystr string ) string { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ char* change(char* mystr ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param mystr string字符串 # @return string字符串 # class Solution def change(mystr) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ def change(mystr: String): String = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ fun change(mystr: String): String { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ public String change (String mystr) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ export function change(mystr: string): string { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ func change ( _ mystr: String) -> String { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param mystr string字符串 * @return string字符串 */ pub fn change(&self, mystr: String) -> String { // write code here } }
"rredd"
"eedrr"