hey guys! not only am i a bit new to the forums, but im also quite new to comp sci itself. i got a hw question that im not sure as to how to make of it. anyone able to help?

i have to write the algorithm below in java format =/

An algorithm gets as input a list of k integer values n1,n2,..nk, as well as a special value SUM. your algorithm must locate the a pair of values in the list N that sum to the value SUM. For example, if your list of values is 3,8,13,2,17,18,10 and SUM was 20, then your algorithm would output either the two values (2,18) or (3,17). if your algorithm cannot find any pair of values that sum to the value SUM, then it should print out the message "sorry, there is no such pair of values"\

thanks a lot guys!