Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

triangle minimum path sum

public class Solution 
{
    public int MinimumTotal(IList<IList<int>> t) 
    {
        for(var i=t.Count-2; i>=0; i-- )
        {
            for(var j=0;j<t[i].Count;j++)
            {
                t[i][j] = Math.Min(t[i][j]+t[i+1][j],t[i][j]+t[i+1][j+1]);
            }
        }
        return t[0][0];
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to make multiplayer game in unity 
Csharp :: wpf set color in code 
Csharp :: create material unity script 
Csharp :: c# base64 encode 
Csharp :: C# array index tostring 
Csharp :: c# linq select from object list 
Csharp :: c# create folder 
Csharp :: unity assembly 
Csharp :: topdown unity 
Csharp :: linux command line switch statement 
Csharp :: how to make a global string c# 
Csharp :: smtp check if email sent 
Csharp :: c# array 
Csharp :: Open another form with C# Winforms 
Csharp :: unity mouse click position 
Csharp :: unity time deltatime 
Csharp :: c# web api return image file 
Csharp :: c# datagridview cell click event 
Csharp :: console reset color c# 
Csharp :: exit button unity code 
Csharp :: add mime type for woff in web.config 
Csharp :: get char lowercase in c# 
Csharp :: save byte array to file c# 
Csharp :: 2d rotation unity 
Csharp :: c# regex find number in string 
Csharp :: what is the meaning of ?? in c# 
Csharp :: how to get the transform of an object in unity 
Csharp :: split string on last element 
Csharp :: .net core check if linux 
Csharp :: datatable to array c# 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =