text: 
  // You should implement your task here.
  
  module.exports = function towelSort (matrix) {
    if(matrix && matrix.length > 0) {
    let result = matrix.reduce((acc, val, i) => {
      i % 2 === 1 ? val = val.reverse() : val = val
      return acc.concat(val)
  })
  return result;
    } else {
      return []
    }
  
  
  }
  