Skip to content
DeepForgeby svx

Silent Bug Hunt

A Python program that passes every shipped test and is one line away from the reference. Find an input where the two diverge. Practice only — nothing here affects your progress, review schedule, or certificates.

Each puzzle is a Python function that passes every shipped test shown below and is one line away from the reference DeepForge ships. Find an input where the two programs diverge; the verdict is the raw fact of the run.

Practice only — nothing here affects your progress, review schedule, or certificates.

This session: caught 0 of 0 tried

Puzzles

EasyAlgorithmsal-127

Reverse Integer

This program passes all 5 shipped tests. Find an input where it diverges from the reference DeepForge ships.

Program under inspection

read-only
def reverse_integer(x):
    sign = -1 if x < 0 else 1
    n = abs(x)
    rev = 0
    while n:
        rev = rev * 10 + n % 10
        n //= 10
    rev *= sign
    if rev < -2 ** 32 or rev > 2 ** 31 - 1:
        return 0
    return rev

Passes all 5 shipped tests

  • reverse_integer(123) → 321
  • reverse_integer(-123) → -321
  • reverse_integer(120) → 21
  • reverse_integer(0) → 0
  • reverse_integer(1534236469) → 0

Runs locally in your browser with Python. Up to 2000 characters; nothing is saved.

Result

No run yet. Type a literal and press Run; the raw result appears here.

1 / 96