Degree of the hierarchical list issued by the S-Expression



  • How do you figure out the depth of the hierarchical list S-Expression based on an analysis of the number of simultaneous open left brackets? For example, the depth of the list (a(b(c)d)e) would be equal to 2 (a(b(c.d)e)(k.f)m), two. Still, I can be wrong here.



  • Find a maximum difference between the number of opening and closing brackets for all sub-structures of different length starting from the beginning.
    You can go through the cycle. substr, you can be honest.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2