Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
lambda x:max(26-x*11,1-(x%12<1)x%12>0)
Try it online!Try it online!
-4 bytes thanks to ovs
If the boolean output is invalid (in Python, True == 1 and False == 0), add + before the max to turn it into an int.
True == 1
False == 0
+
max
lambda x:max(26-x*11,1-(x%12<1))
Try it online!
lambda x:max(26-x*11,x%12>0)