deno.land / x / masx200_leetcode_test@10.6.5 / final-value-of-variable-after-performing-operations / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
export default function finalValueAfterOperations( operations: string[],): number { return operations.reduce( (p, v) => ["X++", "++X"].includes(v) ? p + 1 : p - 1, 0, );}
masx200_leetcode_test

Version Info

Tagged at
a year ago