Prize Draw
Last updated
Was this helpful?
Last updated
Was this helpful?
check st value length. if it's 0 return 'No participants'
check st value names length. if it's less than *n it's not able to figure out so return 'Not enough participants'
define names variable and init with seperated value of *st
iterate process-3
return [names[i] and (names.length + names character accumulate values) * weight[i])
sort process-4 as DESC though element[1] value. if value is name order by ASC with name which means element[0]
return process-4[n-1][0]