Given an array of integers, every element appears twice except for one. Find that single one. Note: ...
Given a non negative integernum, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by , otherwise, you have to subtract from it. Example : Example : ...
2020-02-12 17:13 0 178 推荐指数:
Given an array of integers, every element appears twice except for one. Find that single one. Note: ...
原题地址:http://oj.leetcode.com/problems/valid-number/ 题意:判断输入的字符串是否是合法的数。 解题思路:这题只能用确定有穷状态自动机(DFA)来写会比较优雅。本文参考了http://blog.csdn.net/kenden23/article ...
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting ...
DFS的Flood Fill方法, 不使用额外visited数组,但是用‘1’变成‘2’表示visited的方法 复杂度 时间 O(NM) 空间 O(max(N,M)) 递归栈空间 ...
题目: Determine whether an integer is a palindrome. Do this without extra space. click to show spoi ...
Problem Description: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function ...
Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed ...
Problem Description: A 2d grid map of m rows and n columns is initially filled with water. We may p ...