Strobogrammatic Number — LeetCode
Jan 7, 2021
Here is the question:
Companies that have asked it recently:
This is my solution:
I created a map that contains numbers 0–9. The value for the keys is the number upside down. If it is not a number upside down, I set it to 0.
For every x in num, we append it’s “upside-down” value to a string. We then return true if the reversed string is == to the input num.