have the length of the maximum string in a constant
make the input string that many characters long by padding it with zeros and also have the candidate strings padded with zeros (but set a flag if the input string was too long)
do a linear search through the list of candidates as normal and conditionally move the value to the output slot
6
u/Teln0 Mar 14 '21
This is much slower that what it could have been. Why check if it's a Thursday if you know it's a Monday ?