摘要:
Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element 阅读全文
摘要:
Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa 阅读全文
摘要:
Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library functio 阅读全文
摘要:
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
摘要:
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
摘要:
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
摘要:
Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is b 阅读全文
摘要:
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O 阅读全文
摘要:
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
摘要:
You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id. 阅读全文