摘要:
Using Linked list to implement a Queue. In javascript, if you want to push a item in front of an Array, it need to shift the rest of items, not good f 阅读全文
摘要:
Implement the util type OptionalUndefined<T, Props> that turns all the properties of T that can be undefined, into optional properties. In addition, a 阅读全文
摘要:
Given a number N, find the Nth triangular number, i.e. 1 + 2 + 3 + ... + N /* _____________ Your Code Here _____________ */ export type NumberToArray< 阅读全文
摘要:
Given 2 sets (unions), return its Cartesian product in a set of tuples, e.g. CartesianProduct<1 | 2, 'a' | 'b'> // [1, 'a'] | [2, 'a'] | [1, 'b'] | [2 阅读全文
摘要:
Merge variadic number of types into a new type. If the keys overlap, its values should be merged into an union. For example: type Foo = { a: 1; b: 2 } 阅读全文
摘要:
Implement type CheckRepeatedChars<T> which will return whether type T contains duplicated member For example: type CheckRepeatedTuple<[1, 2, 3]> // fa 阅读全文
摘要:
Remove the key starting with _ from given type T. /* _____________ Your Code Here _____________ */ type PublicType<T extends object> = { [Key in keyof 阅读全文
摘要:
Empty commits might seem unusual, but they offer significant advantages in managing version control. By documenting milestones, triggering automation 阅读全文