deno.land / x / masx200_leetcode_test@10.6.5 / find-positive-integer-solution-for-a-given-equation / CustomFunction.ts

CustomFunction.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export class CustomFunction { #num: number; constructor(x: number) { this.#num = x; } f(x: number, y: number): number { switch (this.#num) { case 1: return x + y; case 2: return x * y; case 3: return x * x + y; case 4: return x + y * y; case 5: return x * x + y * y; case 6: return (x + y) * (x + y); case 7: return x * x * x + y * y * y; case 8: return x * x * y; case 9: return x * y * y; } return 0; }}
masx200_leetcode_test

Version Info

Tagged at
a year ago