We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29ab25a commit f89ee0eCopy full SHA for f89ee0e
1985-find-the-kth-largest-integer-in-the-array.js
@@ -0,0 +1,9 @@
1
+/**
2
+ * @param {string[]} nums
3
+ * @param {number} k
4
+ * @return {string}
5
+ */
6
+const kthLargestNumber = function(nums, k) {
7
+ nums.sort((a, b) => BigInt(b) - BigInt(a) === 0n ? 0 : (BigInt(b) - BigInt(a) > 0n ? 1 : -1) )
8
+ return nums[k - 1]
9
+};
0 commit comments