当前位置:网站首页>1528. rearrange strings
1528. rearrange strings
2022-06-24 08:53:00 【Drag is me】
leetcode Force button to brush questions and punch in
subject :1528. Rearrange strings
describe : Give you a string s And a Same length Array of integers for indices .
Please rearrange the string s , Among them the first i Characters need to be moved to indices[i] The position indicated .
Return the rearranged string .
Their thinking
1、 Water problem , Just write according to the title .
Source code ##
class Solution {
public:
string restoreString(string s, vector<int>& indices) {
int len = indices.size();
string str = s;
for (int i = 0; i < len; ++i) {
str[indices[i]] = s[i];
}
return str;
}
};
边栏推荐
猜你喜欢

什么是图神经网络?图神经网络有什么用?

教程篇(5.0) 08. Fortinet安全架构集成与FortiXDR * FortiEDR * Fortinet 网络安全专家 NSE 5

Jenkins自动化部署,连接不到所依赖的服务【已解决】

ZUCC_ Principles of compiling language and compilation_ Experiment 0607 grammar analysis ll analysis

À propos de ETL il suffit de lire cet article, trois minutes pour vous faire comprendre ce qu'est ETL

A tip to read on Medium for free

opencv最大值滤波(不局限于图像)

China chip Unicorn Corporation

4274. 后缀表达式

数据库迁移从PostgreSQL迁移到 MYSQL
随机推荐
pymysql 向MySQL 插入数据无故报错
何时使用RDD和DataFrame/DataSet
leetcode 1642. Furthest building you can reach
2138. 将字符串拆分为若干长度为 k 的组
4275. Dijkstra序列
【E325: ATTENTION】vim编辑时报错
[team management] 25 tips for testing team performance management
GradScaler MaxClipGradScaler
Determination of monocular and binocular 3D coordinates
China chip Unicorn Corporation
深度学习与神经网络:最值得关注的6大趋势
常用表情符号
Liunx Mysql安装
Matlab camera calibrator camera calibration
Lombok use
2022-06-23:给定一个非负数组,任意选择数字,使累加和最大且为7的倍数,返回最大累加和。 n比较大,10的5次方。 来自美团。3.26笔试。
MBA-day25 最值问题-应用题
用VNC Viewer的方式远程连接无需显示屏的树莓派
Rsync for file backup
项目部署相关