題目

  Write a function to delete a node (except the tail) in a singly linked list, given  only access to that node.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

Question 

  Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

Question

  Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

題目

  Given an array of integers, 1 <= a[i] <= n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

題目

  For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page's area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following requirements:

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

題目

  Given two strings s and t which consist of only lowercase letters.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

題目

  Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is increasing a selected element by 1 or decrementing a selected element by 1.

Davis 發表在 痞客邦 留言(0) 人氣()

Given a binary tree, find its maximum depth.

The maximum depth is the number of nodes along the longest path from the root node down to the fartheast leaf node.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.

題意

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()

Write an algorithm to determine if a number is "happy".

A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this process ends in 1 are happy numbers.

文章標籤

Davis 發表在 痞客邦 留言(0) 人氣()