Check if value fits in byte

Easy
4 views 23 Jan 2026
Task: return true if x can fit in a signed byte (-128..127)....

Convert char digit to int

Easy
4 views 23 Jan 2026
Task: given a digit character '0'..'9', return its integer value....

Absolute difference as long

Easy
4 views 23 Jan 2026
Task: return absolute difference between two ints as a long (avoid overflow)....

Check if string is numeric (no sign)

Easy
7 views 23 Jan 2026
Task: return true if all characters are digits and length > 0....

Parse binary string to int

Easy
5 views 23 Jan 2026
Task: parse a binary string (like 10110) and return integer value....

Clamp value in range

Medium
6 views 23 Jan 2026
Task: clamp x into [low, high] and return clamped value....

Compare doubles with epsilon

Medium
5 views 23 Jan 2026
Task: return true if two doubles are almost equal using epsilon....

Count set bits in int

Medium
5 views 23 Jan 2026
Task: return number of set bits (1s) in binary representation of x....

Safe average without overflow

Medium
4 views 23 Jan 2026
Task: return average of two ints without overflow....

Detect overflow on add

Medium
5 views 23 Jan 2026
Task: return true if a+b overflows 32-bit int....

Convert seconds to hh:mm:ss parts

Hard
6 views 23 Jan 2026
Task: given total seconds, return [hours, minutes, seconds]....

Fast power (pow)

Hard
6 views 23 Jan 2026
Task: compute a^b using fast exponentiation (b >= 0)....

Encode two ints into one long

Hard
6 views 23 Jan 2026
Task: pack two 32-bit ints (a,b) into one long and unpack later....

Compute checksum mod 1e9+7

Hard
7 views 23 Jan 2026
Task: compute checksum = sum(i*value) mod 1e9+7 for array values....

Split integer into digits array

Hard
5 views 23 Jan 2026
Task: return digits of a non-negative number in correct order....