News for hackers. Stuff that matters.
Re:Gaming CS Interviews by sfink on Wednesday September 28, 2022 @06:42AM (#33006496)
Well... sorting a shuffled deck of cards can be done in O(1) time.

    def sort(self):
        pass

    def __getitem__(i):
        suit = int(i / 13)
        rank = i % 13
        return f"{rank} of {('diamonds', 'hearts', 'spades', 'clubs')[suit]}"

There are no comments on this comment yet.