Java solution faster 100% (2ms)
class Solution {\n\n    public int[] maxSubsequence(int[] nums, int k) {\n        int[] ans = new int[k];\n        int sum = 0;\n\n        for (int i = 0; i < k
class Solution {\n\n    public int[] maxSubsequence(int[] nums, int k) {\n        int[] ans = new int[k];\n        int sum = 0;\n\n        for (int i = 0; i < k; i++) {\n            ans[i] = nums[i];\n            sum += nums[i];\n        }\n\n        for (int i = k; i< nums.length; i++) {\n            int idx = 0;\n            int small = ans[0];\n            for (int j = 1; j < k; j++) {\n                if (ans[j] < small) {\n                    small = ans[j];\n                    idx = j;\n                }\n            }\n            if (small < nums[i]) {\n                for (int m = idx + 1; m < k; m++) {\n                    ans[m - 1] = ans[m];\n                }\n                ans[k-1] = nums[i];\n            }\n        }\n        return ans;\n    }\n}
['Array', 'Java']