## Solution to Two Numbers With Sum from Jobdu

8 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1352 Question Name: Two Numbers With Sum Question Description: within a sorted integer array, find two integers, whose sum is the given target value. If there are multiply pairs, find the one with the smallest product. Input: … Read More »

## Solution to Numbers Appear Once from Jobdu

8 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1351 Question Name: Numbers Appear Once Question Description: in an int array, every number appears even count of times, except two numbers, which appear only once. Find the two numbers. Input: the input might contain multiple test … Read More »

## Solution to Tree Depth from Jobdu

7 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1350 Question Name: Tree Depth Question Description: compute the depth of a binary tree. Input: the input might contain multiple test cases. Inside each test case, the first line includes one integers N (1 <= N <= … Read More »

## Solution to Number Of K from Jobdu

7 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1349 Question Name: Number Of K Question Description: count the occurrence of a number in a sorted integer arrray. Input: the input might contain multiple test cases. Inside each test case, the first line includes one integers … Read More »

## Solution to First Common Nodes In Lists from Jobdu

7 Sep

No test case content is given. No response from the admin. No clear statement is provided. I spent a whole day on the input issue. And I still do not know what is wrong with my original input handler. Save … Read More »

## Solution to Inverse Pairs from Jobdu

6 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1348 Question Name: Inverse Pairs Question Description: Given an integer array, for any two numbers, if the former one is less than the latter one, they are an inversion pair. Compute the total count of inversion pairs … Read More »

## Solution to First No Repeating Char from Jobdu

1 Sep

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1283 Question Name: First No Repeating Char Question Description: Given a string with only upper-case letters, find the first non-repeating char. Input: the input might contain multiple test cases. Each line is a test case. Only upper-case … Read More »

## Solution to Ugly Number from Jobdu

31 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1214 Question Name: Ugly Number Question Description: Ugly numbers are the integers, whose prime factors could only be 2, 3, and/or 5. Typically 1 is also considered as an ugly number. We need to find the i(th) … Read More »

## Solution to Sort Array For Min Number from Jobdu

31 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1504 Question Name: Sort Array For Min Number Question Description: Given an integer array, concatenate them as in their string representation, and find out the minimum one among the concatenated results. Input: the input might contain multiple … Read More »

## Solution to Number Of Ones from Jobdu

31 Aug

Question (in Chinese): http://ac.jobdu.com/problem.php?pid=1373 Question Name: Number Of Ones Question Description: Given an integer, find the number of 1s in the string representation of all integers from 0 to it. Input: the input might contain multiple test cases. Each test case … Read More »