Haskell (1 indexed), 29 bytes
Courtesy of AZTECCO
g l=all(`elem`l)[1..length l]
Haskell (0 indexed), (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
ChecksBoth of these check that every integer fromin the available range is in the list. The first is 01 to 1 less than the length of the list, the second is an element0 to 1 less than the length of the list.
Haskell, (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell (1 indexed), 29 bytes
Courtesy of AZTECCO
g l=all(`elem`l)[1..length l]
Haskell (0 indexed), (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Both of these check that every integer in the available range is in the list. The first is 1 to the length of the list, the second is 0 to 1 less than the length of the list.
Haskell, (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree.io solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell, (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree.io solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell, (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell, (削除) 42 (削除ここまで) 32(削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree.io solution.
f x=all(all.(`elem`x).fst)$zip[0.flip elem<*>zip[0.]x.]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell, (削除) 42 (削除ここまで) 32 bytes
f x=all((`elem`x).fst)$zip[0..]x
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.
Haskell, (削除) 42 (削除ここまで) (削除) 32 (削除ここまで) 31 bytes
Lynn saved one byte with the pointfree.io solution.
all.(.fst).flip elem<*>zip[0..]
I tried a bunch of creative stuff with scans, folds and zips, but the boring solution ended up being the shortest.
Checks that every integer from 0 to 1 less than the length of the list is an element of the list.