全部评论
我也是卡一卡了很久慌了,23搞得题都没心思读,直接上4
分享
第一题啥啊?来看看我们做的一样不
分享
滴滴
官网直投
你做的是前端的面试题嘛?
分享
前面的输入输出例子复制进 rider 用的c# 都调试不了 有人遇到了吗
分享
同前端 1没做 2只有60 3做了 4刚做完 最后三秒复制代码上去的时候 复制到第五题上 了...心都碎了 求问楼主 1 2 题思路
分享
虽然并没参加笔试,但看第一题挺有意思就做了做。 思路是递归,有兴趣可以看看。 public class TX_Q1 {
public static void main(String[] args) {
String str = "HG[3|B[1|CA]]F[3|B[1|CA]]BB";
System.out.println(decrypt(str));
}
public static String decrypt(String str) {
if(str.indexOf('[') < 0) return str;
String res = "";
for(int i = 0; i < str.length(); i ++) {
char ch = str.charAt(i);
if(ch == '[') {
int count = 1;
int nStart = i + 1;
while(str.charAt(i) != '|') i ++;
int num = Integer.valueOf(str.substring(nStart, i));
int dStart = i + 1;
while(count > 0) {
i ++;
if(str.charAt(i) == '[') count ++;
if(str.charAt(i) == ']') count --;
}
String ds = decrypt(str.substring(dStart, i));
while(num -- > 0) res += ds;
} else {
res += ch;
}
}
return res;
}
}
分享
请问笔试是用js写的还是java
分享
相关推荐
点赞 评论 收藏
转发
03-27 13:29
东南大学 计算机类 点赞 评论 收藏
转发