Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,22 +0,0 @@
|
|||
function Get-EquilibriumIndex ( $Sequence )
|
||||
{
|
||||
$Indexes = 0..($Sequence.Count - 1)
|
||||
$EqulibriumIndex = @()
|
||||
|
||||
ForEach ( $TestIndex in $Indexes )
|
||||
{
|
||||
$Left = 0
|
||||
$Right = 0
|
||||
ForEach ( $Index in $Indexes )
|
||||
{
|
||||
If ( $Index -lt $TestIndex ) { $Left += $Sequence[$Index] }
|
||||
ElseIf ( $Index -gt $TestIndex ) { $Right += $Sequence[$Index] }
|
||||
}
|
||||
|
||||
If ( $Left -eq $Right )
|
||||
{
|
||||
$EqulibriumIndex += $TestIndex
|
||||
}
|
||||
}
|
||||
return $EqulibriumIndex
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-EquilibriumIndex -7, 1, 5, 2, -4, 3, 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue