Write a program in Java to solve a specific algorithmic problem, such as array manipulation or string processing, within a strict time limit.