Easy · Math

Is strobogrammatic number

Given a string s of digits, return true if s reads the same after a 180° rotation (0, 1 and 8 rotate to themselves, 6 and 9 rotate into each other, and 2, 3, 4, 5, 7 cannot be rotated), otherwise false.

Examples

Example 1

{
  "s": "69"
}

Output: true

Example 2

{
  "s": "962"
}

Output: false

Rebuild it in the studio

Open every published interview problem, solution, scene, and memory room free, with no account.

More Math problems