The TransCompilator

Solved LeetCode program · 96 of 1,000

#0096 · Unique Binary Search Trees

Medium Math chunk-02.md

Original English source

The target is 5. The size is target plus 1. The ways is a list of size zeros. Set item 0 of ways to 1.
For every count from 1 to target.
For every split from 0 to one less than count.
The before is item split of ways. The afterposition is count minus 1 minus split. The after is item afterposition of ways. Increase item count of ways by before times after.

Show item target of ways.

Open in Playground Browse all 1,000 problems

Expected stdout

42