😎풀이

  1. image를 순회
    1-1. 각 pixel을 역순으로 정렬
    1-2. 정렬된 결과를 bit 반전
  2. 변환된 집합을 반환
function flipAndInvertImage(image: number[][]): number[][] {
    return image.map(pixel => {
        const flip = pixel.reverse()
        const invert = flip.map(a => a ? 0 : 1)
        return invert
    })
};
profile
내 지식을 공유할 수 있는 대담함

0개의 댓글