please help in this java program.... 2345 1345 1245 1235 1234
public class UniqueCombinations { public static void find(String s) { find("", s); } private static void find(String prefix, String s) { if(prefix.length()==4){ System.out.println(prefix); } for (int i = 0; i < s.length(); i++) find(prefix + s.charAt(i), s.substring(i + 1)); } public static void main(String[] args) { String st = "12345"; find(st); System.out.println(); } }
Ads