Back to Type Challenges

README

questions/02257-medium-minusone/README.md

latest1.4 KB
Original Source
<!--info-header-start--><h1>MinusOne </h1><blockquote><p>by Mustafo Faiz <a href="https://github.com/fayzzzm" target="_blank">@fayzzzm</a></p></blockquote><p><a href="https://tsch.js.org/2257/play" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.zh-CN.md" target="_blank"></a> </p><!--info-header-end-->

Given a number (always positive) as a type. Your type should return the number decreased by one.

For example:

ts
type Zero = MinusOne<1> // 0
type FiftyFour = MinusOne<55> // 54
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/2257/answer" target="_blank"></a> <a href="https://tsch.js.org/2257/solutions" target="_blank"></a> <!--info-footer-end-->