Greater Than
提出詳細
// small number only type GreaterThan< T extends number, U extends number, TArr extends readonly unknown[]=[], UArr extends readonly unknown[]=[]> = T extends TArr["length"] ? false : U extends UArr["length"] ? true : GreaterThan<T,U,[...TArr,0],[...UArr,0]>
提出日時 | 2023-09-18 03:23:17 |
---|---|
問題 | Greater Than |
ユーザー | sankantsu |
ステータス | Accepted |
import type { Equal, Expect } from '@type-challenges/utils' type cases = [ Expect<Equal<GreaterThan<1, 0>, true>>, Expect<Equal<GreaterThan<5, 4>, true>>, Expect<Equal<GreaterThan<4, 5>, false>>, Expect<Equal<GreaterThan<0, 0>, false>>, Expect<Equal<GreaterThan<20, 20>, false>>, Expect<Equal<GreaterThan<10, 100>, false>>, Expect<Equal<GreaterThan<111, 11>, true>>, ]