Development/Algorithm

[LeetCode] 5. Longest Palindromic Substring (Kotlin)
https://leetcode.com/problems/longest-palindromic-substring/ Longest Palindromic Substring - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { var index: Int = 0 var maxLen: Int = 0 fun longestPalindrome(s: String): String { val len = s.length if (len < 2) { return s..

[LeetCode] 4. Median of Two Sorted Arrays (Kotlin)
https://leetcode.com/problems/median-of-two-sorted-arrays/ Median of Two Sorted Arrays - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { fun findMedianSortedArrays(nums1: IntArray, nums2: IntArray): Double { val mergedNums = mutableListOf() var idx1 = 0 var idx2 = ..

[LeetCode] 3. Longest Substring Without Repeating Characters (Kotlin)
https://leetcode.com/problems/longest-substring-without-repeating-characters/ Longest Substring Without Repeating Characters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com import kotlin.math.max class Solution { fun lengthOfLongestSubstring(s: String): Int { if (s.length

[LeetCode] 26. Remove Duplicates from Sorted Array (Kotlin)
https://leetcode.com/problems/remove-duplicates-from-sorted-array/ Remove Duplicates from Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com class Solution { fun removeDuplicates(nums: IntArray): Int { var cnt = if (nums.isEmpty()) 0 else 1 for (i in 1 until nums.size) ..

[LeetCode] 198. House Robber (Kotlin)
https://leetcode.com/problems/house-robber/ House Robber - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com import java.util.Collections.max class Solution { fun rob(nums: IntArray): Int { var previous = 0 var answer = 0 for (i: Int in nums.indices) { val originAnswer = answer answe..