class Solution:
    def prefixesDivBy5(self, A: List[int]) -> List[bool]:
        ans,t = [],0
        for a in A:
            t = (t * 2 + a)%5
            ans.append(False if t else True)
        return ans

 

相关文章:

  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-18
  • 2021-07-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-17
  • 2022-01-27
  • 2022-12-23
  • 2019-03-24
  • 2021-05-20
  • 2022-03-04
相关资源
相似解决方案