-> replaced un-changed lists by tuples for better runtime & memory savings.
-> removed str conversion ahead of input as it always returns a string.
-> removed unnecessary 'return None' statements.
-> optimized for loops.
-> other minor optimizations.
Made the following changes:
-> replaced un-changed lists by tuples for better runtime & memory savings. -> removed str conversion ahead of input as it always returns a string. -> removed unnecessary 'return None' statements. -> optimized for loops. -> other minor optimizations.