Skip to content

evdeg/codetest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Booj Code Test

Fun times with equilibrium indexes on an array.

What is an equilibrium index?

An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at higher indices.

Instructions

Write a function that, given a sequence, returns its equilibrium indices (if any). Assume that the sequence may be very long. Feel free to Google for hints, but give lots of comments about what your thoughts are and your process for devising an algorithm.

Running the Test

phpunit EquilibriumIndexTest.php

About

booj code test

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%