java - Array of strings from array of pairs? -
is there anyway return array of strings array of pairs? i'm guessing it's hashmap since 2 values involved. simple example explanation :)
as pointed out @dasblinkenlight, if input (y,3),(t,2) , want output "ypp","tp" string should have length of numerical value given. , after taking character, rest of length filled p.
suppose i've got static method,
public static line[] get(couple[] temp) i need complete main method produce following result:
get (new couple[]{new couple(’e’,4), new couple(’n’,2)}) should return array of strings
{"eppp", "np"} hope helps :)
class pair{ public pair(string st1,string st2){ string1=str; string2=str; } private string string1; private string string2; // + getters , maybe setters strings; } later on create simple pair[] , whatever want
Comments
Post a Comment