LeetCode 136: Single Number Without Growing Extra Storage

Problem Requirement You are given a non-empty integer array nums. Exactly one element appears once. Every other element appears exactly twice. Return the element that appears once. LeetCode provides this method contract: singleNumber(nums: List[int]) -> int The solution must also satisfy two resource requirements: O(n) time O(1) extra space Example 1 Input: nums = [2,2,1] Output: 1 2 appears twice. Only 1 appears once. Example 2 Input: nums = [4,1,2,1,2] Output: 4 Both 1 and 2 have matching copies. Only 4 remains unpaired. ...

July 15, 2026 · 6 min · map[name:Jeanphilo]

XOR and RC4: From Principles to Go Practice (with Safer Alternatives)

XOR and RC4: From Principles to Go Practice (with Safer Alternatives) Subtitle / Abstract Use minimal math to explain XOR and RC4, provide runnable Go examples, and clarify why RC4 is considered insecure with recommended alternatives. Target readers Backend engineers reading legacy RC4 code Beginners who confuse encoding and encryption Intermediate developers building a stream-cipher mental model Background / Motivation Many systems still contain RC4 or custom decryption logic. Common mistakes include treating Base64 as encryption and ignoring integrity checks. Understanding XOR and RC4 helps you evaluate security correctly and avoid copying outdated designs into new systems. ...

December 16, 2025 · 3 min · map[name:Jeanphilo]