728x90 코틀린3 [kotlin] leetcode - Squares of a Sorted Array 977. Squares of a Sorted Array : https://leetcode.com/problems/squares-of-a-sorted-array/ Squares of a 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 sortedSquares(nums: IntArray): IntArray { for(i in 0 until nums.size){ nums[i] *= nums[i]; } va.. 2022. 4. 27. [kotlin] leetcode - Search Insert Position 35. Search Insert Position : https://leetcode.com/problems/search-insert-position/ Search Insert Position - 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 searchInsert(nums: IntArray, target: Int): Int { var low = 0; var high = nums.lastIndex; while(lo.. 2022. 4. 27. [kotlin] leetcode - Binary Search 704. Binary Search : https://leetcode.com/problems/binary-search/submissions/ Binary Search - 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 search(nums: IntArray, target: Int): Int { //nums에 특정 값 있는 지 확인 var check = nums.contains(target) if(check == true){ va.. 2022. 4. 26. 이전 1 다음 728x90 반응형