Sort by

recency

|

373 Discussions

|

  • + 0 comments

    def summingSeries(n): s=(n*n)%(1000000007) return s

  • + 0 comments

    Tried BigInt in js, but cannot pass all test cases.

  • + 0 comments
        return (n % M * n % M) %M
    
  • + 0 comments

    It is just binpow(n, 2, mod) for c++

  • + 0 comments

    golang solution

    func summingSeries(n int64) int32 {
        mod := int64(1000000007)
        
        return int32(((n % mod) * (n % mod)) % mod)
    }