Is It the Same Upside Down?

Published by Deep Xavier in

The number 6090609 has a special property: if you turn the number upside down (imagine rotating your screen 180 degrees), you get 6090609 again.

Write a function that takes a string on the digits 0, 6, 9 and returns true if the number is the same upside down or false otherwise.

Examples

sameUpsidedown("6090609") ➞ true

sameUpsidedown("9669") ➞ false
// Becomes 6996 when upside down.

sameUpsidedown("69069069") ➞ true

Notes

N/A

Watch a quick demo on how Edabit works.