
December 2014. Gangnam Style becomes the first video to pass 2,147,483,647 views on YouTube, which is exactly the largest number a signed 32-bit integer can hold. The counter rolls over, and Google publicly jokes that they had to upgrade the view count to a 64-bit integer to keep up with Psy. Show what the odometer read the moment it wrapped.
Objective
Return the number a signed 32-bit counter would display for a given real view count, wrapping when it overflows.
Steps
$ displayed_views(1000)
1000
$ displayed_views(2147483647)
2147483647
$ displayed_views(2147483648)
-2147483648
Expected files
Allowed functions
None. Write every helper yourself.
Loading solutions...