Java Easy Understanding - 8ms List & Array
\nclass Solution {\n    public int[] maxSubsequence(int[] nums, int k) {\n        ArrayList<Integer> list = new ArrayList<Integer>();\n        int arr[] = Array
```\nclass Solution {\n    public int[] maxSubsequence(int[] nums, int k) {\n        ArrayList<Integer> list = new ArrayList<Integer>();\n        int arr[] = Arrays.copyOfRange(nums, 0, nums.length);\n        Arrays.sort(arr);\n        for(int i=arr.length-1; i>=(arr.length-k); i--){\n            list.add(arr[i]);\n        }\n        int res[] = new int[k];\n        int ind = -1;\n        int index;\n        for(int i=0; i<nums.length; i++){\n            index = list.indexOf(nums[i]);\n            if(index != -1){\n                list.remove(index);\n                ind += 1;\n                if(ind >= k)\n                    break;\n                res[ind] = nums[i];\n            }\n        }\n        return res;\n    }\n}\n```
['Java']