u010510962 于 2016.03.28 10:11 提问

Lintcode name 'Solution' is not defined EXITCODE=1

`````` class Solution:
# @param n: An integer.
# return : A list of integer storing 1 to the largest number with n digits.
def numbersByRecursion(self, n):
# write your code here
if n <1:
return None
numList = []
for i in range(10):
print i
number =[]
print number
number.append(i)
print 'number[0]= ',number
self.setOnebyOne(numList, number,n,0)

def setOnebyOne(self,numList,number,n,index):
if index == n-1:
print 'index = n-1',n-1,number
numList.append(number)
return numList

print index,'setting',number

for i in range(10):
if i == 0:
number.append(i)
else:
number[index+1] = i
print number
self.setOnebyOne(numList, number,n,index+1)
'''这里如果是return则最里面的递归语句返回后接着执行的是return语句，函数就返回了，而不是返回上一层递归调用。
'''

``````

1个回答

CSDNXIAOS   2016.03.30 11:28

Caused by: There is no result type defined for type 'json' mapped with name 'rebback'. Did you mean 'json'? - result......

----------------------Hi，地球人，我是问答机器人小S，上面的内容就是我狂拽酷炫叼炸天的答案，除了赞同，你还有别的选择吗？