摘要:
For a given source string and a target string, you should output the first index(from 0) of target string in source string. If target does not exist i 阅读全文
摘要:
Given a string and an offset, rotate string by offset. (rotate from left to right) Given a string and an offset, rotate string by offset. (rotate from 阅读全文
摘要:
Unique Paths I A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or 阅读全文
摘要:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example Given lists: [ 2->4->null, null, -1->null ] 阅读全文
摘要:
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文
摘要:
Ugly Number Write a program to check whether a given number is an ugly number`. Ugly numbers are positive numbers whose prime factors only include 2, 阅读全文
摘要:
Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 and n. k can be 0 - 9. Count the number of k's between 0 an 阅读全文
摘要:
Write a function that add two numbers A and B. You should not use + or any arithmetic operators. 分析: 典型的Bit Operation. 阅读全文
摘要:
Write an algorithm which computes the number of trailing zeros in n factorial. Have you met this question in a real interview? Yes Write an algorithm 阅读全文
摘要:
For an array A, if i < j, and A [i] > A [j], called (A [i], A [j]) is a reverse pair.return total of reverse pairs in A. For an array A, if i < j, and 阅读全文