python 函数名大小写

# -*- coding:utf-8 -*-
class Solution:
    # array 二维列表
    def Find(self, target, array):
        # write code here
        n = len(array)
        flag = 'false'
        if array == [[]]:
            return flag
        i = n-1
        j = 0
        
        while i >= 0 and j <= n-1:
            if target < array[i][j]:
                i = i - 1
            elif target > array[i][j]:
                j = j + 1
            else:
                flag = 'true'
                break
        return flag

    
while True:
    try:
        S = Solution()
        L = list(eval(raw_input()))
        array = L[1]
        target = L[0]
        print(S.find(target,array))
        
    except:
        break;
    
        

调用的时候写成了小写的f,您的代码已保存
答案错误:您提交的程序没有通过所有的测试用例
case通过率为11.76%

用例:
5,[[1,2,8,9],[2,4,9,12],[4,7,10,13],[6,8,11,15]]

对应输出应该为:

false

你的输出为:

true

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值