6 kyu

Handshake problem

127 of 13,406Laurynas Lazauskas

Description:

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).

Algorithms

More By Author:

Check out these other kata created by Laurynas Lazauskas

Stats:

CreatedJun 7, 2015
PublishedJun 7, 2015
Warriors Trained25955
Total Skips1024
Total Code Submissions44492
Total Times Completed13406
Ruby Completions127
JavaScript Completions9710
Python Completions1793
C# Completions374
Java Completions644
C Completions295
CoffeeScript Completions17
Julia Completions25
Crystal Completions9
R Completions49
Go Completions91
COBOL Completions12
TypeScript Completions135
Haskell Completions29
Rust Completions62
D Completions7
SQL Completions433
Total Stars244
% of votes with a positive feedback rating85% of 890
Total "Very Satisfied" Votes691
Total "Somewhat Satisfied" Votes139
Total "Not Satisfied" Votes60
Total Rank Assessments29
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Laurynas Lazauskas Avatar
  • ZozoFouchtra Avatar
  • ParanoidUser Avatar
  • JohanWiltink Avatar
  • Voile Avatar
  • Madjosz Avatar
  • Souzooka Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • pa-m Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • dfhwze Avatar
Ad