Thursday, February 1, 2018

Leetcode 726: Number of atoms (V)

February 1, 2018

Introduction


It is hard level algorithm and I like to learn one thing a time through the practice. This practice is based on the coding blog written in Chinese, and I like to develop a blog based on the idea.

Here is the Chinese blog link.

Analysis of the algorithm


The idea is to find the first close bracket ')' and then look ahead for the number and look backward to find open bracket to match the close bracket.

Here is C++ code to study. I will write a C# solution based on C++ code.

No comments:

Post a Comment