发布网友 发布时间:2022-04-22 09:48
共2个回答
懂视网 时间:2022-05-07 02:16
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted. public class StringManipulation { public static void main(String args[]) { String s
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
public class StringManipulation {
public static void main(String args[]) {
String s1 = "ba";
String s2 = "cbaaaabbcaaaa";
for (int i = 0; i < s1.length(); i++) {
for (int j = 0; j>=0 && s2.length()>0 &&j < s2.length(); j++) {
while(s1.charAt(i) ==s2.charAt(j)){//处理连续状况
s2 = s2.substring(0, j) + s2.substring(j + 1);
j--;
System.out.println(s2+s2.length()+" "+j);
if(j<0){j=0;}
if(s2.equals(""))break;
}
}
}
System.out.println(s2+"!!!");
}
}
热心网友 时间:2022-05-06 23:24
given的意思:
adj. 规定的,指定的;倾向于;<古>(文件)(已在某日期由某人)签署的;赠送的;假定的,假设的
prep. 考虑到;如果,倘若
n. 假定事实
v. 给予(give 的过去分词形式)
【名】 (Given)(英、土)吉文(人名)
短语
Given name 名字 ; 教名
Any Given Sunday 挑战星期天 ; 再战星期天 ; 再战星期日 ; 任何一个星期天
loss given default 违约损失率 ; 损失率 ; 违约损失 ; 二是违约损失率
同根词
词根: give
n.
give 弹性;弯曲;伸展性
giving 给予;礼物;给予物
giver 给予者,赠予人;送礼者
v.
giving 给;赠送(give的ing形式);付出;产生
vi.
give 捐赠;面向;有弹性;气候转暖
vt.
give 给;产生;让步;举办;授予