I have understood the question but Iām unable to build an approach for this problem
Building logic for the problem
hello @vketan182
approach is simple
read a number as string (say s) .
if left most character is ā9ā
- then leave the leftmost character as it is and for other characters simpl replace s[i] with min(s[i],ā9ā-s[i])
else:
- for each i replace s[i] with min(s[i],ā9ā-s[i])
print s