Homework07

A MathWikiből
(Változatok közti eltérés)
(Új oldal, tartalma: „==Parenthesis Depth== Write a function called parenthesis_depth : its input is a string which is a well formed expression with parenthesis and its output is a string w…”)
 
(Parenthesis Depth)
1. sor: 1. sor:
==Parenthesis Depth==
+
==Problem 1: Parenthesis Depth==
 
Write a function called parenthesis_depth : its input is a string which is a well formed expression with parenthesis and  its output is a string with same length but the symbols are changed to numbers which are the depth of the surrounding parenthesis. Don't modify the parenthesis symbols but every other symbol.
 
Write a function called parenthesis_depth : its input is a string which is a well formed expression with parenthesis and  its output is a string with same length but the symbols are changed to numbers which are the depth of the surrounding parenthesis. Don't modify the parenthesis symbols but every other symbol.
  

A lap 2021. május 2., 08:58-kori változata

Problem 1: Parenthesis Depth

Write a function called parenthesis_depth : its input is a string which is a well formed expression with parenthesis and its output is a string with same length but the symbols are changed to numbers which are the depth of the surrounding parenthesis. Don't modify the parenthesis symbols but every other symbol.

There won't be more then nine parenthesis in depth!

Example

a*(b+c) → 00(111)
-(1/(2-3)) → 0(11(222))
Személyes eszközök