CodeWars-6-kyu-Soluitions/Handshake Problem At Master - GitHub

Skip to content Dismiss alert {{ message }} / CodeWars-6-kyu-Soluitions Public
  • Notifications You must be signed in to change notification settings
  • Fork 63
  • Star 159
  • Code
  • Issues
  • Pull requests
  • Actions
  • Projects
  • Security
  • Insights
Additional navigation options

Files

 master

Breadcrumbs

  1. CodeWars-6-kyu-Soluitions
Handshake problemBlameBlame

Latest commit

 

History

History14 lines (10 loc) · 674 Bytes master
  1. CodeWars-6-kyu-Soluitions
Handshake problemTop

File metadata and controls

  • Code
  • Blame
14 lines (10 loc) · 674 BytesRaw1234567891011121314/*Johnny is a farmer and he annually holds a beet farmers convention "Drop the beet". Every year he takes photos of farmers handshaking. Johnny knows that no two farmers handshake more than once. He also knows that some of the possible handshake combinations may not happen. However, Johnny would like to know the minimal amount of people that participated this year just by counting all the handshakes. Help Johnny by writing a function, that takes the amount of handshakes and returns the minimal amount of people needed to perform these handshakes (a pair of farmers handshake only once).*/ function getParticipants(h){ for(var i=0,k=1;i<h;i+=k++); return k;} You can’t perform that action at this time.

Tag » Codewars-6-kyu Solutions Github