LeetCode----172. Factorial Trailing Zeroes(Java)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode----172. Factorial Trailing Zeroes(Java)相关的知识,希望对你有一定的参考价值。

 1 package singlenumber136;
 2 //Given an array of integers, every element appears twice except for one. Find that single one.
 3 //Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
 4 public class Solution {
 5      public static int singleNumber(int[] nums) {
 6         int result=0;
 7         for(int i=0;i<nums.length;i++)
 8             result^=nums[i];
 9         return result;
10     }
11 
12     public static void main(String[] args) {
13         // TODO Auto-generated method stub
14         int[] nums={1,1,2,3,2,4,5,4,5};
15         System.out.println(singleNumber(nums));
16 
17     }
18 
19 }

 

以上是关于LeetCode----172. Factorial Trailing Zeroes(Java)的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode172 Factorial Trailing Zeroes. LeetCode258 Add Digits. LeetCode268 Missing Number

Leetcode 172. Factorial Trailing Zeroes

LeetCode 172. 阶乘后的零(Factorial Trailing Zeroes)

Leetcode 172 Factorial Trailing Zeroes

leetcode 172. Factorial Trailing Zeroes

Java [Leetcode 172]Factorial Trailing Zeroes