Skip to content

simple javascript algorythm to break a chain of integer in 3 parts at 2 indexes(P and Q) with some conditions: 0<P<Q<N-1 ; P < Q -1 ; with N the lenght of the chain

License

Notifications You must be signed in to change notification settings

LionelZoc/breakchain-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

breakchain-js

simple algo to break a chain of integer in 3 part by cutting at two index P and Q with some conditions.

you have an array A containing N integers that represent a chain. the goal is to cut the chain at two different point to have 3 small chains.

the chain will be cut at P and Q with theses conditions: P and Q are not adjacent

0<P<Q<N-1 ; P < Q -1 ;

the chain can be then cut like this:

[0, P-1][p+1, q-1][Q+1, N-1]

About

simple javascript algorythm to break a chain of integer in 3 parts at 2 indexes(P and Q) with some conditions: 0<P<Q<N-1 ; P < Q -1 ; with N the lenght of the chain

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published