Skip to main content
added 36 characters in body
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

Does not assume sorted input. :/

Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument as the right argument rather than reuse the original right argument, given a dyad.

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument as the right argument rather than reuse the original right argument, given a dyad.

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

Does not assume sorted input. :/

Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument as the right argument rather than reuse the original right argument, given a dyad.

added 140 characters in body
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!Try it online!

Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument toas the right argument rather than reuse the original right argument, given a dyad.

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument to the right argument rather than reuse the original right argument, given a dyad.

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

Since shrinking the crowd never makes anyone not help, this calculates the new crowd size from the previous one until nobody new leaves.

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument as the right argument rather than reuse the original right argument, given a dyad.

added 323 characters in body
Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument to the right argument rather than reuse the original right argument, given a dyad.

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

Jelly, 9 bytes

Lİ<SɗƬạLṪ 

Try it online!

 Ƭ Loop until a fixed point, starting from L the length of the input: <Sɗ how many elements of the input are strictly greater than İ the reciprocal? ạL Subtract each intermediate result from the length of the input, Ṫ and return the last one. 

Uses Ƭ ... Ṫ instead of ÐL because ÐL passes the previous left argument to the right argument rather than reuse the original right argument, given a dyad.

Source Link
Unrelated String
  • 23.9k
  • 3
  • 37
  • 61
Loading