LCR182
某公司门禁密码使用动态口令技术。初始密码为字符串 password,密码更新均遵循以下步骤:
- 设定一个正整数目标值
target - 将
password前target个字符按原顺序移动至字符串末尾
请返回更新后的密码字符串。
示例 1:
输入: password = "s3cur1tyC0d3", target = 4 输出: "r1tyC0d3s3cu"
class Solution(object): def dynamicPassword(self, password, target): """ :type password: str :type target: int :rtype: str """ return(password[target:]+password[0:target])
经典简单题一行

Work Hard
But do not forget to enjoy life😀
本文来自博客园,作者:YuhangLiuCE,转载请注明原文链接:https://www.cnblogs.com/YuhangLiuCE/p/17779513.html
posted on 2023-10-21 20:33 YuhangLiuCE 阅读(18) 评论(0) 收藏 举报
浙公网安备 33010602011771号