ArrayList<integer> arrayList = new ArrayList(); Stack<integer> stack = new Stack<>(); LstNode tmp = lstNode; while (tmp != null) { stack.push(tmp.val); tmp = tmp.next; } final int size = stack.size(); for (int i = 0; i < size; i++) { arrayList.add(stack.pop()); }</integer></integer>
点赞

相关推荐

牛客383479252号:9,2学生暑期实习失利开始投小厂,给这群人整自信了
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务