mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-23 19:50:47 +00:00
13 lines
152 B
Plaintext
13 lines
152 B
Plaintext
int steps(int x) {
|
|
var n = 0;
|
|
while (x > 1) {
|
|
n += 1;
|
|
if (x & 1) {
|
|
x = 3 * x + 1;
|
|
} else {
|
|
x >>= 1;
|
|
}
|
|
}
|
|
return n;
|
|
}
|