Skip to main content

Posts

Showing posts from December, 2022

Advent of code 2022 problem 2 part 2 Javascript solution

  let   a2 = `A Y B X C Z` ;      let   max = 0 ;           let   b1   =   a2 . split ( '\n' )      b1 . forEach (( elem )=>{          let   first   =   elem . split ( ' ' )[ 0 ];          let   second   =   elem . split ( ' ' )[ 1 ];          if ( second   ==   'Y' )   // make it draw          {              let   nn   =   first == 'A' ?   1 :   first   ==   'B'   ?   2   : 3 ;              max   +=   3   +   nn ;      ...