Answers for "3-6-9 binarysearch"

0

3-6-9 binarysearch

class Solution:
   def solve(self, n):
      string = "no-fill"
      ls=[str(i) for i in range(1,n+1)]
      for i in range(len(ls)):
         if int(ls[i])%3==0:
            ls[i]=string
         elif '3' in ls[i]:
            ls[i]=string
         elif '6' in ls[i]:
            ls[i]=string
         elif '9' in ls[i]:
            ls[i]=string
      return ls
ob = Solution()
print(ob.solve(20))
Posted by: Guest on May-29-2021

Browse Popular Code Answers by Language