Or using StringBuilder for efficiency:

public static String combine(String[][] arr) { StringBuilder sb = new StringBuilder(); for (int row = 0; row < arr.length; row++) { for (int col = 0; col < arr[row].length; col++) { sb.append(arr[row][col]); if (!(row == arr.length - 1 && col == arr[row].length - 1)) { sb.append(" "); } } }

def combine(arr): result = [] for row in arr: for item in row: result.append(item) return " ".join(result)

If you do not have a legal right to access the content you are trying to access, please do not use Beebs.io. For more information, please read our Terms of Service.