It is waay simpler to solve by converting it to binary. Find the largest power of 2 that fits in 400 -> 2^8 = 256 Same for the remaining 144 -> 2^7 = 128 Same for the remaining 16 -> 2^4 The approach shown in the video serves no better purpose, it’s neither faster nor more general