力扣,https://leetcode.cn/problems/que-shi-de-shu-zi-lcof/description/
solution1
线性扫描,一般情况
class Solution {public int takeAttendance(int[] records) {boolean[] visited new boolean[records.length 1];Arrays.fill(visited, fals…
23.合并K个升序链表 方法:顺序合并
在前面已经知道合并两个升序链表的前提下,用一个变量ans来维护以及合并的链表,第i次循环把第i个链表和ans合并,答案保存到ans中
/*** Definition for singly-linked list.* public class List…