Professional Documents
Culture Documents
public static void solution(String str, String asf, int count, int pos) {
if (pos == str.length()) {
if (count == 0)
System.out.println(asf);
else
System.out.println(asf + count);
return;
char ch = str.charAt(pos);
if (count > 0) {
} else {
}
GOLD MINE 2
public static void getmax(int[][]arr, int i , int j , boolean[][] visited, ArrayList<Integer> bag){
if(i<0 || j<0 || i >= arr.length || j >= arr[0].length || visited[i][j] == true || arr[i][j] ==0) return;
visited[i][j] = true;
bag.add(arr[i][j]);
getmax(arr,i-1,j,visited,bag);
getmax(arr,i,j-1,visited,bag);
getmax(arr,i+1,j,visited,bag);
getmax(arr,i,j+1,visited,bag);
for(int i =0 ;i<arr.length;i++){
for(int x : bag){
sum = sum + x;