diff --git a/KthLargest/KthLargest.kt b/KthLargest/KthLargest.kt new file mode 100755 index 0000000..5650690 --- /dev/null +++ b/KthLargest/KthLargest.kt @@ -0,0 +1,8 @@ +import java.util.* +fun findKthLargest(nums: IntArray, k: Int): Int { + Arrays.sort(nums) + return nums[nums.size - k] +} +fun main(args: Array) { + println(findKthLargest(intArrayOf(3,2,1,5,6,4), 2)) +} \ No newline at end of file