Pular para o conteúdo principal

3 documentos selecionados com "number-theory"

Ver todas os Marcadores

Open Lockers

This question is asked by Facebook. In a gym hallway there are N lockers. You walk back and forth down the hallway opening and closing lockers. On your first pass you open all the lockers. On your second pass, you close every other locker. On your third pass you open every third locker. After walking the hallway N times opening/closing lockers in the previously described manner, how many lockers are left open?

Reverse Integer

This question is asked by Apple. Given a 32-bit signed integer, reverse it and return the result.

Self Divisible Numbers

Given an integer N, return the total number of self divisible numbers that are strictly less than N (starting from one).