本文主要是介绍#力扣:LCR 182. 动态口令@FDDLC,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
LCR 182. 动态口令
一、Java
class Solution {public String dynamicPassword(String password, int target) {return password.substring(target) + password.substring(0, target);}
}
二、C++
#include <string>
using namespace std;
class Solution {
public:string dynamicPassword(string password, int target) {return password.substr(target) + password.substr(0, target);}
};
三、Python
class Solution:def dynamicPassword(self, password: str, target: int) -> str:return password[target:] + password[0:target]
四、JavaScript
var dynamicPassword = function(password, target) {return password.substring(target) + password.substring(0, target);
};
五、Go
package mainfunc dynamicPassword(password string, target int) string {return password[target:] + password[0:target];
}
这篇关于#力扣:LCR 182. 动态口令@FDDLC的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!