Skip to content

Instantly share code, notes, and snippets.

View statulr's full-sized avatar
🍵
matcha is genuinly yummy

robb statulr

🍵
matcha is genuinly yummy
View GitHub Profile
@statulr
statulr / solution.c
Last active November 30, 2023 16:05
leetcode2148 (Faster than 100%)
//https://leetcode.com/problems/minimum-one-bit-operations-to-make-integers-zero/submissions/1109638560/
#include <stdio.h>
unsigned int minimumOneBitOperations(unsigned int n) {
uint32_t result = 0;
while (n) {
result ^= n;
n >>= 1;
}
return result;