## 645. Set Mismatch

The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of …

## 202. Happy Number

Write an algorithm to determine if a number is “happy”. A happy number is a number defin…

## 258. Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.…

## 231. Power of Two

Given an integer, write a function to determine if it is a power of two. class Solution { public boo…

## 263. Ugly Number

Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers…

## 507. Perfect Number

We define the Perfect Number is a positive integer that is equal to the sum of all its positive divi…

## 172. Factorial Trailing Zeroes

Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in log…

## 633. Sum of Square Numbers

Given a non-negative integer c, your task is to decide whether there’re two integers a and b s…

## 598. Range Addition II

Given an m * n matrix M initialized with all 0‘s and several update operations. Operations are…

## 326. Power of Three

Given an integer, write a function to determine if it is a power of three. Follow up: Could you do i…