Rakesh Singh

Rakesh Singh

  • NA
  • 57
  • 7.6k

Combinations in javascript

Sep 9 2018 1:50 AM
Write a javascript program to distribute n identical objects among the r persons.
 
Example: n=2 identical objects.
 and r=2 , persons
so output would be like {1,1}{0,2} {2,0} 
 
function distribute(n,r){
 
 
and one more problem I have
 
Write a javascript function to decrypt the letters in alphabet
for Example : input : nrfzh i.e. n : n +3=q, r:r+3=u and so on.
Output: 'quick'
function decrypt(input){
}
 
 Please help.
Thanks in Advance. 

Answers (4)