字符串排序 用例不通过

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        Queue<String> pq = new PriorityQueue<>(n);
        for (int i = 0; i < n; i++) {
            pq.offer(sc.next());
        }
        System.out.println(pq.stream().reduce((x, y) -> x + " " + y).get());
    }
}


为什么会有一半用例不通过啊 想知道哪些用例没通过
全部评论

相关推荐

见见123:简历没有啥问题,是这个社会有问题。因为你刚毕业,没有工作经历,现在企业都不要没有工作经历的。社会病了。
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-09 12:10
直接上图
牛客13578115...:改得一般,不值80
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务