public void sort3(List<Integer> list) {
        if (list.size() < 2)
            return;

        int count = 0;
        int end = list.size();
        while (end > 0) {
            boolean swapped = false;
            int lastSwap = 0;
            for (int idx = 0; idx < end - 1; ++idx) {
                int left = list.get(idx);
                int right = list.get(idx + 1);
                if (left > right) {
                    list.set(idx + 1, left);
                    list.set(idx, right);

                    swapped = true;
                    lastSwap = idx + 1;
                }

                ++count;    // loop time
            }
            end = lastSwap;

            if (!swapped)
                break;
        }

        LH_.checkNaive(list);
        System.out.println("Looped " + count + " times");
    }