Alternating Characters

  • + 0 comments

    //java public static int alternatingCharacters(String s) { return (int)IntStream.range(0, s.length()-1).filter(i->s.charAt(i)==s.charAt(i+1)).count(); }