Explore
Explore the challenges. Embrace the opportunity to grow, learn, and showcase your programming abilities. We hope you find the perfect challenge!
Explore the challenges. Embrace the opportunity to grow, learn, and showcase your programming abilities. We hope you find the perfect challenge!
Default generic arguments allow you to optionally pass a generic argument.
Give generic function types to your functions
Generic types are like function arguments.
Generic type constraints allow us to restrict the possible types a generic type will accept.
Hello, World!
In Type Challenges, we use the type system itself to do the assertion.
For this ch
Index signatures allow us to handle types where the properties are a non-specific literal value.
If we have a type which is a wrapped type like Promise, how we can get the type which is inside th
Implement the JavaScript Array.concat
function in the type system. A type takes the two argument
Implement the built-in Exclude<T, U>
Exclude from
T
those types that are assignable toU
Implement a generic First<T>
that takes an Array T
and returns its first element's type.
For
Implement the util type If<C, T, F>
which accepts condition C
, a truthy value T
, and a falsy
Implement the JavaScript Array.includes
function in the type system. A type takes the two argume
Implement the Absolute
type. A type that take string, number or bigint. The output should be a p
Returns true if all elements of the list are equal to the second parameter passed in, false if the
Implement type AllCombinations<S>
that return all combinations of strings which use characte
Implement Python liked any
function in the type system. A type takes the Array and returns `true
Find the elements in the target array that appear only once. For example:input: `[1,2,2,3,3,4,5,6,
For given function type Fn
, and any type A
(any in this context means we don't restrict the ty
Sometimes we want to use the good old for
-loop with an index to traverse the array, but in this
Given an integer array nums, return the number of reverse pairs in the array.
A reverse pair is
Currying is the technique of converting a function that
Implement a type Distribute Unions
, that turns a type of data structure containing union types i
Given below routes, infer its dynamic params. | Route | Params Type Defi
Implement a generic GetReadonlyKeys<T>
that returns a union of the readonly keys of an Object.
You have a target object and a source array of objects. You need to copy property from source to t
Implement BinaryAdd
to add two binary numbers together. The numbers should not be translated out
Implement BinaryToDecimal<S>
which takes an exact string type S
consisting 0 and 1 and returns
Implement BitwiseXOR<S1,S2>
which takes two binary string literal type and returns a binary
There is a function in C language: printf
. This function allows us to print something with forma
Implement CamelCase<T>
which converts snake_case
string to camelCase
.
For example
ty