Space-efficient writing of functional notation
Just treat '.'(
as the opening bracket, ,'.'(
as the comma, and increment the integer count of closing parens to be output in the end as the closing bracket.
Thus O(1) auxiliary space.
Just treat '.'(
as the opening bracket, ,'.'(
as the comma, and increment the integer count of closing parens to be output in the end as the closing bracket.
Thus O(1) auxiliary space.