Posts

Showing posts from June, 2021

Green and Red

  class Solution { static int RedOrGreen ( int N , String S ) { int Red = 0 , Green = 0 ; for ( int i = 0 ; i < N ; i ++) { if ( S . charAt ( i ) == 'R' ) Red ++; else Green ++; } return Math . min ( Red , Green ); } }