{"task_id": "0", "problem": "Write a python function to remove first and last occurrence of a given character from the string.", "completion": "\ndef remove_occ(string, char):\n    new_string = string.replace(char, '')\n    return new_string\n\n\nassert remove_occ(\"hello\", \"l\") == \"heo\"\nassert remove_occ(\"abcda\", \"a\") == \"bcd\"\nassert remove_occ(\"PHP\", \"P\") == \"H\"\n", "passed": true}
{"task_id": "1", "problem": "Write a function to sort a given matrix in ascending order according to the sum of its rows.", "completion": "\ndef sort_matrix(matrix):\n    # Get the sums of the rows of the matrix\n    row_sums = [sum(row) for row in matrix]\n    # Sort the rows of the matrix based on the sums\n    sorted_rows = sorted(matrix, key=lambda x: x[0])\n    # Return the sorted matrix\n    return sorted_rows\n\n\nassert sort_matrix([[1, 2, 3], [2, 4, 5], [1, 1, 1]])==[[1, 1, 1], [1, 2, 3], [2, 4, 5]]\nassert sort_matrix([[1, 2, 3], [-2, 4, -5], [1, -1, 1]])==[[-2, 4, -5], [1, -1, 1], [1, 2, 3]]\nassert sort_matrix([[5,8,9],[6,4,3],[2,1,4]])==[[2, 1, 4], [6, 4, 3], [5, 8, 9]]\n", "passed": false}
