From f342e4b826291bbdecaf6e8f68a0ae81c653977c Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Sat, 8 Jul 2023 15:21:25 +0800 Subject: [PATCH] feat: update ts solution to lc problem: No.0231 --- solution/0200-0299/0231.Power of Two/README.md | 4 ++-- solution/0200-0299/0231.Power of Two/README_EN.md | 4 ++-- solution/0200-0299/0231.Power of Two/Solution.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/solution/0200-0299/0231.Power of Two/README.md b/solution/0200-0299/0231.Power of Two/README.md index 2483012af8107..e3126fa0e15a5 100644 --- a/solution/0200-0299/0231.Power of Two/README.md +++ b/solution/0200-0299/0231.Power of Two/README.md @@ -183,7 +183,7 @@ func isPowerOfTwo(n int) bool { ```ts function isPowerOfTwo(n: number): boolean { - return n > 0 && (n & (n - 1)) == 0; + return n > 0 && (n & (n - 1)) === 0; } ``` @@ -191,7 +191,7 @@ lowbit: ```ts function isPowerOfTwo(n: number): boolean { - return n > 0 && (n & (n - 1)) == 0; + return n > 0 && (n & (n - 1)) === 0; } ``` diff --git a/solution/0200-0299/0231.Power of Two/README_EN.md b/solution/0200-0299/0231.Power of Two/README_EN.md index 40d60f5d849f3..8a2f4b5be62c1 100644 --- a/solution/0200-0299/0231.Power of Two/README_EN.md +++ b/solution/0200-0299/0231.Power of Two/README_EN.md @@ -146,7 +146,7 @@ func isPowerOfTwo(n int) bool { ```ts function isPowerOfTwo(n: number): boolean { - return n > 0 && (n & (n - 1)) == 0; + return n > 0 && (n & (n - 1)) === 0; } ``` @@ -154,7 +154,7 @@ lowbit: ```ts function isPowerOfTwo(n: number): boolean { - return n > 0 && n == (n & -n); + return n > 0 && n === (n & -n); } ``` diff --git a/solution/0200-0299/0231.Power of Two/Solution.ts b/solution/0200-0299/0231.Power of Two/Solution.ts index 5c4abb675d1da..bfb580cec5184 100644 --- a/solution/0200-0299/0231.Power of Two/Solution.ts +++ b/solution/0200-0299/0231.Power of Two/Solution.ts @@ -1,3 +1,3 @@ function isPowerOfTwo(n: number): boolean { - return n > 0 && (n & (n - 1)) == 0; + return n > 0 && (n & (n - 1)) === 0; }