您当前的位置: 首页 >  leetcode

LeetCode Algorithm 704. 二分查找

发布时间:2022-01-11 09:30:39 ,浏览量:0

704. 二分查找

Ideas

这题想考察二分查找的来着。

对不起,真的对不起,作为Python爱好者,实在没忍住,就一行代码解决了。

Code Python
from typing import List class Solution: def search(self, nums: List[int], target: int) -> int: return nums.index(target) if target in nums else -1 
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    108697博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.2386s