字符串排序 用例不通过

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());
    }
}


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

相关推荐

牛客266927136号:为啥实习经历写这么少,项目经历反而大写特写,最重要的还是实习经历吧,写具体点,什么场景下做了什么事,解决了什么问题,优化了什么场景,性能提升了多少多少
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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