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 ...