2 ms·
The bitmasks in the code are adjusted so that it works with that specific pattern of numbers to other letters. Masks only pick bits from digits when the are in
by kukkamario 3y ago
The bitmasks in the code are adjusted so that it works with that specific pattern of numbers to other letters. Masks only pick bits from digits when the are in those specific positions.
So this solution only works when the digit character places are fixed and known.
It would be possible to generate mask based on the first nibbles so that it would ignore non-digits. Maybe even with some fairly optimized vector instructions. Not sure would it be faster than some naive solution.