Skip to main content
2 of 4
improved algorythm
pajonk
  • 18.3k
  • 3
  • 26
  • 74

Matlab, 74 71 bytes

s=input('');x=s(end);[s(1:end-1) [0 46]+(x>46)*[47 46]+(x>47)*[45 -45]]

Based on the last character, it computes the last two characters.

pajonk
  • 18.3k
  • 3
  • 26
  • 74