求助,credit report上的public record# Law - 律师事务所
f*o
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.
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.