JAVA solution using list || All test cases passed
\nclass Solution {\n    public int[] maxSubsequence(int[] nums, int k) {\n        List<Integer>l=new ArrayList<>();\n        List<Integer>a=new ArrayList<>();\n
```\nclass Solution {\n    public int[] maxSubsequence(int[] nums, int k) {\n        List<Integer>l=new ArrayList<>();\n        List<Integer>a=new ArrayList<>();\n        int b[]=new int[k];\n        for(int i=0;i<nums.length;i++)l.add(nums[i]);\n        Collections.sort(l);\n        Collections.reverse(l);\n        System.out.println(l);\n        int j=0,c=k;\n        while(k>0)\n        {\n            a.add(l.get(j));\n            j+=1;\n            k-=1;\n        }\n        j=0;\n        for(int i=0;i<nums.length;i++)\n        {\n            if(a.contains(nums[i])==true && j<c)\n            {\n                b[j]=nums[i];\n                a.remove(a.indexOf(nums[i]));\n                j+=1;\n            }\n        }\n        return b;\n    }\n}\n```
['Array', 'Java']