diff --git a/questions/18142-medium-all/README.md b/questions/18142-medium-all/README.md new file mode 100644 index 000000000..ca0914f43 --- /dev/null +++ b/questions/18142-medium-all/README.md @@ -0,0 +1,11 @@ +Returns true if all elements of the list are equal to the second parameter passed in, false if there are any mismatches. + +For example + +```ts +type Test1 = [1, 1, 1] +type Test2 = [1, 1, 2] + +type Todo = All // should be same as true +type Todo2 = All // should be same as false +``` diff --git a/questions/18142-medium-all/info.yml b/questions/18142-medium-all/info.yml new file mode 100644 index 000000000..5f2757199 --- /dev/null +++ b/questions/18142-medium-all/info.yml @@ -0,0 +1,7 @@ +difficulty: medium +title: All +author: + github: cutefcc + name: cutefcc +tags: array + diff --git a/questions/18142-medium-all/template.ts b/questions/18142-medium-all/template.ts new file mode 100644 index 000000000..9227ddaa8 --- /dev/null +++ b/questions/18142-medium-all/template.ts @@ -0,0 +1 @@ +type All = any diff --git a/questions/18142-medium-all/test-cases.ts b/questions/18142-medium-all/test-cases.ts new file mode 100644 index 000000000..df8ad145b --- /dev/null +++ b/questions/18142-medium-all/test-cases.ts @@ -0,0 +1,13 @@ +import type { Equal, Expect } from '@type-challenges/utils' + +type cases = [ + Expect, true>>, + Expect, false>>, + Expect, true>>, + Expect, false>>, + Expect, true>>, + Expect, false>>, + Expect, true>>, + Expect, true>>, + Expect, true>>, +];