2 Star 10 Fork 2

CG国斌 / myleetcode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
OrderSearch.py 385 Bytes
一键复制 编辑 原始数据 按行查看 历史
Charies Gavin 提交于 2020-02-06 12:44 . 初始化 myleetcode 项目
"""
author: Charies Gavin
date: 11/8/19,3:46 PM
https:github.com/guobinhit
description: Order Search
"""
def order_search(nums, target):
if len(nums) == 0:
return -1
elif len(nums) < 2 and nums[0] != target:
return -1
index = 0
while index < len(nums):
if nums[index] == target:
return index
index += 1
return -1
Java
1
https://gitee.com/guobinhit/myleetcode.git
git@gitee.com:guobinhit/myleetcode.git
guobinhit
myleetcode
myleetcode
master

搜索帮助