deno.land / x / masx200_leetcode_test@10.6.5 / power-of-three / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
export default function isPowerOfThree(n: number): boolean { if (n === 0) return false; // const a= (Math.log(n)/Math.log(3)) // return Math.abs(Math.floor(a)-a)<1e-14 return n === Math.pow(3, Math.floor(Math.log(n) / Math.log(3)));}
masx200_leetcode_test

Version Info

Tagged at
a year ago