#牛客在线求职答疑中心# 短期实习用写在简历吗,一个月那种的
全部评论
点赞 回复 分享
发布于 08-08 15:46 北京

相关推荐

    public static void main(String[] args) {        Scanner in = new Scanner(System.in);        List times = new ArrayList();        String[] s = in.nextLine().split("[,\\[\\]]");        String[] s1 = Arrays.copyOfRange(s, 1, s.length);        int[] t = Arrays.stream(s1).mapToInt(Integer::parseInt).toArray();        for (int i = 0; i < t.length; i++) {            times.add(t[i]);        }        System.out.println(getMaxTime(times));    }    public static String getMaxTime(List<Integer> times) {        StringBuilder stringBuilder = new StringBuilder();        int[][] maxTimeTable = {{2,0},{4,9},{5,0},{9,9},{5,0},{9,9}};        int pro = 0;        for (int i = 0; i < maxTimeTable.length; i++) {            int max = 0;            if (i == 1 && pro == 2) {                max = maxTimeTable[i][0];            } else if (i == 1) {                max = maxTimeTable[i][1];            } else                max = maxTimeTable[i][0];            while (!times.contains(max)) {                max--;            }            stringBuilder.append(max);            if (i == 1 || i == 3)                stringBuilder.append(":");            times.remove((Integer) max);            pro = max;        }        return stringBuilder.toString();    }
查看2道真题和解析 投递华为等公司10个岗位
点赞 评论 收藏
分享
3 1 评论
分享
牛客网
牛客企业服务