f*****o 发帖数: 1151 | 1 请问一下JAVA考题最佳算法是啥?
Problem 1:
Write a method which given two integers, returns the integer that is closest
to 1000.
Problem 2:
Write a method which given a string, returns a string where every character
in the original is doubled. For example, given the string "xyz";, return the
string "xxyyzz";
Problem 3:
Write a method which takes an array of integers. The method should return
true if there is a way to split the array in two so that the sum of the
numbers on one side of the split equals the sum of the numbers on the other
side.
Problem 4
Write a method which given a string, returns a string with an asterisk
inserted between every character in the original. Use recursion in your
solution. |
|