Ad
Code
Diff
  • def rotateLeft(array):
        return [list(x) for x in zip(*array)[::-1]]
    
    def rotateRight(array):
        return [list(x[::-1]) for x in zip(*array)]
    • def rotateLeft(array):
    • return [[x[-i-1] for x in array] for i in range(len(array[0]))]
    • return [list(x) for x in zip(*array)[::-1]]
    • def rotateRight(array):
    • return [[x[i] for x in array][::-1] for i in range(len(array[0]))]
    • return [list(x[::-1]) for x in zip(*array)]
Code
Diff
  • getIDS <- function(string) {
      sum(as.integer(unlist(strsplit(string, ""))))
    }
    
    • def getIDS(string):
    • return sum(int(x) for x in string)
    • getIDS <- function(string) {
    • sum(as.integer(unlist(strsplit(string, ""))))
    • }