LeetCode-Swift
LeetCode-Swift copied to clipboard
Solutions to LeetCode by Swift
@soapyigu after a long time, I am adding this PR :)
- Update deprecated solution with new method signature and removal of Interval class definition. - Mirror Merge Intervals question difficulty definition with LeetCode link.
Multiple lines for `func verticalOrder(_ root: TreeNode?) -> [[Int]] { `. Please remove one. [https://github.com/soapyigu/LeetCode-Swift/blob/master/Tree/BinaryTreeVerticalOrderTraversal.swift](url) Just wanted to know, would you be able to submit the solution in Leetcode? For...
Add a solution to Convert Sorted List to Binary Search Tree
Just provide an improved solution for 'Search insert position', it's is more concise and elegant, though the time complexity and space complexity are the same.
### https://github.com/soapyigu/LeetCode-Swift/blob/master/Array/SlidingWindowMaximum.swift testcase: [ 2, 3, 4, 2, 6, 2, 5, 1 ] expected: [4, 4, 6, 6, 6, 5] errorResult: [4, 4, 6, 6, 5, 5] ### Modify ```...
Use Binary search is more efficient in both time complexity and space complexity.
I solove 703. Please check it. https://leetcode.com/problems/kth-largest-element-in-a-stream