[LeetCode][Python3] 35. Search Insert Position
2018. 9. 12. 01:31 |
프로그래밍/LeetCode
Problem :
https://leetcode.com/problems/search-insert-position/description/
My Solution :
class Solution:
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
i = 0
while i < len(nums):
if target <= nums[i]:
return i
i += 1
return i
'프로그래밍 > LeetCode' 카테고리의 다른 글
[LeetCode][Python3] 38. Count and Say (0) | 2018.09.21 |
---|---|
[LeetCode][Python3] 665. Non-decreasing Array (0) | 2018.09.13 |
[LeetCode][Python3] 705. Design HashSet (0) | 2018.09.12 |
[LeetCode][Python3] 706. Design HashMap (0) | 2018.09.12 |
[LeetCode][Python3] 28. Implement strStr() (0) | 2018.09.12 |
[LeetCode][Python3] 27. Remove Element (0) | 2018.09.11 |
[LeetCode][Python3] 26. Remove Duplicates from Sorted Array (0) | 2018.09.11 |
[LeetCode][Python3] 7. Reverse Integer (0) | 2018.09.11 |
최근에 달린 댓글 최근에 달린 댓글