All Downloads are FREE. Search and download functionalities are using the official Maven repository.

g0001_0100.s0096_unique_binary_search_trees.Solution.swift Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
// #Medium #Dynamic_Programming #Math #Tree #Binary_Tree #Binary_Search_Tree
// #Dynamic_Programming_I_Day_11 #Big_O_Time_O(n)_Space_O(1)
// #2024_06_25_Time_0_ms_(100.00%)_Space_15.3_MB_(56.25%)

class Solution {
    func numTrees(_ n: Int) -> Int {
        var result: Int64 = 1
        for i in 0..




© 2015 - 2025 Weber Informatics LLC | Privacy Policy