Kotlin Leetcode 解題紀錄
這邊列舉一些用 Kotlin 解答 leetcode 題目的內容
基礎問題
- 2235. Add Two Integers
- 2413. Smallest Even Multiple
- 268. Missing Number
- 258. Add Digits
- 1952. Three Divisors
- 412. Fizz Buzz
- 202. Happy Number
- 231. Power of Two
- 326. Power of Three
- 342. Power of Four
- 1342. Number of Steps to Reduce a Number to Zero
- 1603. Design Parking System
- 2520. Count the Digits That Divide a Number
- 2769. Find the Maximum Achievable Number
- 2894. Divisible and Non-divisible Sums Difference
遞迴
- 70. Climbing Stairs
- 509. Fibonacci Number
- 1137. N-th Tribonacci Number
- 1979. Find Greatest Common Divisor of Array
二進位操作
- 190. Reverse Bits
- 191. Number of 1 Bits
- 338. Counting Bits
- 2220. Minimum Bit Flips to Convert Number
陣列
- 2469. Convert the Temperature
- 977. Squares of a Sorted Array
- 26. Remove Duplicates from Sorted Array
- 27. Remove Element
- 35. Search Insert Position
- 53. Maximum Subarray
- 66. Plus One
- 88. Merge Sorted Array
- 121. Best Time to Buy and Sell Stock
- 153. Find Minimum in Rotated Sorted Array
- 169. Majority Element
- 171. Excel Sheet Column Number
- 217. Contains Duplicate
- 383. Ransom Note
- 485. Max Consecutive Ones
- 1051. Height Checker
- 1299. Replace Elements with Greatest Element on Right Side
- 1389. Create Target Array in the Given Order
- 1431. Kids With the Greatest Number of Candies
- 1476. Subrectangle Queries
- 1480. Running Sum of 1d Array
- 1588. Sum of All Odd Length Subarrays
- 1672. Richest Customer Wealth
- 1920. Build Array from Permutation
- 1929. Concatenation of Array
- 1979. Find Greatest Common Divisor of Array
- 2011. Final Value of Variable After Performing Operations
- 2032. Two Out of Three
- 2037. Minimum Number of Moves to Seat Everyone
- 2357. Make Array Zero by Subtracting Equal Amounts
- 2367. Number of Arithmetic Triplets
- 2418. Sort the People
- 2535. Difference Between Element Sum and Digit Sum of an Array
- 2798. Number of Employees Who Met the Target
- 3190. Find Minimum Operations to Make All Elements Divisible by Three
字串
- 2396. Strictly Palindromic Number
- 2942. Find Words Containing Character
- 1678. Goal Parser Interpretation
- 7. Reverse Integer
- 9. Palindrome Number
- 10. Regular Expression Matching
- 12. Integer to Roman
- 13. Roman to Integer
- 20. Valid Parentheses
- 28. Implement strStr()
- 58. Length of Last Word
- 67. Add Binary
- 125. Valid Palindrome
- 151. Reverse Words in a String
- 168. Excel Sheet Column Title
- 205. Isomorphic Strings
- 242. Valid Anagram
- 500. Keyboard Row
- 520. Detect Capital
- 535. Encode and Decode TinyURL
- 657. Robot Return to Origin
- 771. Jewels and Stones
- 804. Unique Morse Code Words
- 1071. Greatest Common Divisor of Strings
- 1108. Defanging an IP Address
- 1221. Split a String in Balanced Strings
- 1323. Maximum 69 Number
- 1528. Shuffle String
- 1662. Check If Two String Arrays are Equivalent
- 1689. Partitioning Into Minimum Number Of Deci-Binary Numbers
- 1816. Truncate Sentence
- 1832. Check if the Sentence Is Pangram
- 1844. Replace All Digits with Characters
- 1859. Sorting the Sentence
- 2000. Reverse Prefix of Word
- 2114. Maximum Number of Words Found in Sentences
- 2194. Cells in a Range on an Excel Sheet
- 2315. Count Asterisks
- 2325. Decode the Message
- 3110. Score of a String
- 3280. Convert Date to Binary
二分搜尋法
隊列
樹
- 100. Same Tree
- 101. Symmetric Tree
- 104. Maximum Depth of Binary Tree
- 110. Balanced Binary Tree
- 226. Invert Binary Tree
- 572. Subtree of Another Tree
- 617. Merge Two Binary Trees
- 965. Univalued Binary Tree
- 1022. Sum of Root To Leaf Binary Numbers
- 2236. Root Equals Sum of Children
鏈結串列
- 21. Merge Two Sorted Lists
- 83. Remove Duplicates from Sorted List
- 141. Linked List Cycle
- 206. Reverse Linked List
- 234. Palindrome Linked List
- 876. Middle of the Linked List