Timeline for Shortest Code to Find the Smallest Missing Positive Integer
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 27, 2023 at 15:04 | comment | added | Jos Woolley |
@EngineerToast Great stuff! You should post that! I guess we can make it 44 bytes, viz =MIN(IFNA(""&MATCH(ROW(A:A),A:A,),ROW(A:A))) .
|
|
Feb 27, 2023 at 12:38 | comment | added | Engineer Toast |
48 byte solution that assumes values are input individually into the cells in column A but you could save a byte by replacing ,A:A,0) with just ,A#,0) if you did assume that: =MIN(IFERROR(""&MATCH(ROW(A:A),A:A,0),ROW(A:A))) . Don't change ROW(A:A) to ROW(A#) , though. That would only work if the size of the input is larger than the first integer that was missing and that's not the case for [1, 2, 3] .
|
|
Feb 26, 2023 at 16:11 | history | answered | Jos Woolley | CC BY-SA 4.0 |