389. Valid Sudoku【LintCode java】】的更多相关文章

Description Determine whether a Sudoku is valid. The Sudoku board could be partially filled, where empty cells are filled with the character .. A valid Sudoku board (partially filled) is not necessarily solvable. Only the filled cells need to be vali…
Description Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Example The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]"…
Description Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Have you consider that the string might be empty? This is a good question to ask during an interview. For the purpose of this pr…
Description Given a binary tree, find all paths that sum of the nodes in the path equals to a given number target. A valid path is from root node to any of the leaf nodes. Example Given a binary tree, and target = 5: 1 / \ 2 4 / \ 2 3 return [ [1, 2,…
Description Implement an algorithm to delete a node in the middle of a singly linked list, given only access to that node. Example Linked list is 1->2->3->4, and given node 3, delete the node in place 1->2->4 解题:删除指定的结点.由于java没有delete 或者 fr…
Description Given a linked list, swap every two adjacent nodes and return its head. Example Given 1->2->3->4, you should return the list as 2->1->4->3. Challenge Your algorithm should use only constant space. You may not modify the value…
Description Cosine similarity is a measure of similarity between two vectors of an inner product space that measures the cosine of the angle between them. The cosine of 0° is 1, and it is less than 1 for any other angle. See wiki: Cosine Similarity H…
Description Given a boolean 2D matrix, 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we consider them in the same island. We only consider up/down/left/right adjacent. Find the number of islands. Example Given gra…
Description Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. A word is defined as a character sequence consists of non-spa…
Description The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or …