Skip to main content
Became Hot Network Question
added 221 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

A useful note from xnor:

I think it's important for solvers to realize that you have to be outputting list entries as you go in some situations. There's no hope to find which list is longest then fully output it.

A useful note from xnor:

I think it's important for solvers to realize that you have to be outputting list entries as you go in some situations. There's no hope to find which list is longest then fully output it.

added 109 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

You're guaranteed that there won't be any ties for longest between two distinct lists. That is, if two lists are tied for longest, whether they are finite or infinite, they will be equal so it won't matter which one you output.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5]
[9,8,12,3]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

You're guaranteed that there won't be any ties for longest between two distinct lists. That is, if two lists are tied for longest, whether they are finite or infinite, they will be equal so it won't matter which one you output.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

You're guaranteed that there won't be any ties for longest between two distinct lists. That is, if two lists are tied for longest, whether they are finite or infinite, they will be equal so it won't matter which one you output.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5]
[9,8,12,3]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]
deleted 101 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

  • If one list is longer than all others your program must output it.
  • If there is a tie between lists and those lists are equal your program must output one of those lists.
  • In any other case, i.e. when there is a tie between unequal lists, your programs behavior is undefined. You may do anything including looping forever.

You're guaranteed that there won't be any ties for longest between two distinct lists. That is, if two lists are tied for longest, whether they are finite or infinite, they will be equal so it won't matter which one you output.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

  • If one list is longer than all others your program must output it.
  • If there is a tie between lists and those lists are equal your program must output one of those lists.
  • In any other case, i.e. when there is a tie between unequal lists, your programs behavior is undefined. You may do anything including looping forever.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]

In this challenge you will take a non-empty (finite) list of (possibly infinite) lists of positive integers, and your task is to output the longest one. An infinite list is longer than a finite list of any length, and any two infinite lists are equally long.

You're guaranteed that there won't be any ties for longest between two distinct lists. That is, if two lists are tied for longest, whether they are finite or infinite, they will be equal so it won't matter which one you output.

Standard rules apply for outputting an infinite list.

This is . The goal is to minimize the size of your source code as measured in bytes.

Test cases

[1,1,1,1,1,1,1,1]
[2,2,2]
[]
=>
[1,1,1,1,1,1,1,1]
[1,1,1,1,1,1,1,1]
[2,2,2,9,9,9,9,9,9]
[]
=>
[2,2,2,9,9,9,9,9,9]
[1,2,3]
[1,2,3]
[2,4]
=>
[1,2,3]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[2,6,4,5,6,7,8,9,10,11,12,13,...]
=>
[2,6,4,5,6,7,8,9,10,11,12,13,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,9,10,11,12,...]
[1,2,3,4,5,6,7,8,12]
[9,2]
=>
[1,2,3,4,5,6,7,8,9,10,11,12,...]

The following cases are examples of undefined behavior, you may do whatever you wish including looping forever.

[1,2,3]
[1,2,3]
[2,6,7]
[2,4,6,8,10,12,14,16,...]
[1,3,5,7,9,11,13,15,...]
Clarified infinite length
Source Link
xnor
  • 146.6k
  • 26
  • 279
  • 652
Loading
added 387 characters in body
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661
Loading
Source Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661
Loading