Java LazySort
\nclass Solution {\n    private static final int BBL = 30;\n    private static final int SLT = 50;\n    private static final int IST = 80;\n    private static f
```\nclass Solution {\n    private static final int BBL = 30;\n    private static final int SLT = 50;\n    private static final int IST = 80;\n    private static final int QCK = 300;\n    private static final int LZY = 1000;\n    private static final Random rnd = new Random();\n    int[] ns;\n    int n;\n    public List<Integer> sortArray(int[] nums) {\n        this.ns = nums;\n        n = nums.length;\n        if (n < BBL){\n            bbl(); \n        } else if (n < SLT) {\n            slt();\n        } else if (n < IST){\n            ist();\n        } else if (n < QCK){\n            quick(0, n - 1);\n        } else if (n < LZY) {\n            mrg(0, n - 1);\n        } else {\n            lazySort();\n        }\n        List<Integer> res = new ArrayList<>();\n        for (int i : ns){\n            res.add(i);\n        }\n        return res;\n    }\n    \n    private void ist(){\n        for (int i = 0; i < n; i++) {\n            for (int j = i; j > 0; j--) {\n                if (ns[j] < ns[j - 1]){\n                    swap(j, j - 1);\n                }\n            }\n        }\n    }\n    \n    private void bbl(){\n        for (int i = n - 1; i >= 0; i--){\n            for (int j = 0; j < i; j++) {\n                if (ns[j] > ns[j + 1]){\n                    swap(j, j + 1);\n                }\n            }\n        }\n    }\n    \n    private void mrg(int st, int ed) {\n        if (st >= ed) return;\n        int mid = (st + ed) >> 1;\n        mrg(st, mid);\n        mrg(mid + 1, ed);\n        merge(st, mid, ed);\n    }\n    \n    private void merge(int st, int mid, int ed){\n        int[] arr = new int[ed - st + 1];\n        int i = st, j = mid + 1, index = 0;\n        while(i <= mid && j <= ed) {\n            if (ns[i] < ns[j]) {\n                arr[index++] = ns[i++];\n            } else {\n                arr[index++] = ns[j++];\n            }\n        }\n        while(i <= mid) {\n            arr[index++] = ns[i++];\n        }\n        while(j <= ed) {\n            arr[index++] = ns[j++];\n        }\n        index = 0;\n        while (st <= ed){\n            ns[st++] = arr[index++];\n        }\n    }\n    \n    private void quick(int st, int ed){\n        if (st >= ed) return;\n        int p = st + rnd.nextInt(ed - st + 1);\n        int pv = ns[p], idx = st + 1;\n        swap(st, p);\n        for (int i = st + 1; i <= ed; i++){\n            if (ns[i] < pv) {\n                swap(i, idx);     // remember idx++;\n                idx++;\n            }\n        }\n        swap(st, --idx);  // bug point\n        quick(st, idx - 1);\n        quick(idx + 1, ed);\n    }\n    \n    private void slt() {\n        for (int i = 0; i < n; i++) {\n            int minIdx = i;\n            for (int j = i + 1; j < n; j++){\n                if (ns[j] < ns[minIdx]){\n                    minIdx = j;\n                }\n            }\n            swap(i, minIdx);\n        }\n    }\n    \n    private void lazySort(){\n        Arrays.sort(ns);\n    }\n    \n    private void swap(int i, int j){\n        if (i == j) return;  // not working ofr i == j\n        ns[i] ^= ns[j];\n        ns[j] ^= ns[i];\n        ns[i] ^= ns[j];\n    }\n}\n```
[]