O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Find nth digit

Suhas S Inglês 1 flashcard

Flashcards do conjunto (1)

  1. 1Input: 11 Output: 0 Explanation: The 11th digit of the sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... is a 0, which is part of the number 10.class Solution:
    def findNthDigit(self, n: int) -> int:
    first, length, size = 1, 1, 9
    while n > length * size:
    n -= length * size
    length += 1
    first *= 10
    size *= 10
    first += (n-1)// length
    word = str(first)
    return int(word[(n-1)%length])

Informações

Descrição
FlashCards sobre Find nth digit, criado por Suhas S em 14-05-2018.
Criado por
Suhas S
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?