feat : add leetcode daily solution

This commit is contained in:
2025-08-13 14:22:48 +08:00
parent 3b1ffd3b14
commit 80c8ed405c
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
public class Solution {
public bool IsPowerOfThree(int n) {
if(n <= 0)
return false;
if(n == 1)
return true;
if(n % 3 != 0)
return false;
return IsPowerOfThree(n/3);
}
}
class program{
static void Main(){
var Solution = new Solution();
Console.WriteLine(Solution.IsPowerOfThree(9));
Console.WriteLine(Solution.IsPowerOfThree(0));
Console.WriteLine(Solution.IsPowerOfThree(-1));
}
}