• Leetcode 837. New 21 | Python


    837. New 21 Title Source: leetcode https://leetcode-cn.com/problems/new-21-game subject Alice participates in a game based on the blackjack rule, which is described as follows: Alice starts with 0 and draws numbers when her score is less than k. When extracting, she randomly gets an integer from the range of [1, w] as a fraction to accumulate, […]

  • Using pigeons to understand the principle of HTTPS


    preface Any activity on the network can be attributed to sending and receiving messages before the server. We can think of sending and receiving these messages as being realized by pigeons. It’s ridiculous, but it’s true. Http One day Alice sent a “I love you” message to Bob through a pigeon. But Alice’s rival, Mallory, […]

  • Leetcode 1025. Divisor game | Python


    1025. Divisor game Source: leetcode https://leetcode-cn.com/problems/divisor-game subject Alice and Bob play games together. They take turns. Alice started first. At first, there was a number n on the blackboard. In each player’s turn, players need to do the following: Choose any onex, satisfy0 < x < NAndN % x == 0 。 useN – xReplace […]

  • [reprint] using carrier pigeon to explain the HTTPS protocol


    Cryptography is a difficult subject to understand because it is full of mathematical theorems. But unless you’re going to actually develop a system of encryption algorithms, you don’t have to force yourself to understand those profound mathematical theorems. If you’re reading this article to design the next set of HTTPS protocol, I’m sorry to say […]