Strobogrammatic Number I, II, III | Leetcode Locked
Strobogrammatic Number I, II, III
Question
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).
Write a function to determine if a number is strobogrammatic. The number is represented as a string.
For example, the numbers "69", "88", and "818" are all strobogrammatic.
The following is the C++ implementation of the suggested solution using a look-up table (implemented as an unordered_map). It takes 0 ms. But, I wonder, are there any real applications of strobogrammatic numbers?
Read full article from Strobogrammatic Number I, II, III | Leetcode Locked
No comments:
Post a Comment