Ad
  • Custom User Avatar

    That's because your solution does not handle the specified kind of input. In input you have no numbers, the mountains are given literally as a map filled with ^. Look at the sampel tests, and the example input:

        char[][] mountain = {
          "^^^^^^        ".toCharArray(),
          " ^^^^^^^^     ".toCharArray(),
          "  ^^^^^^^     ".toCharArray(),
          "  ^^^^^       ".toCharArray(),
          "  ^^^^^^^^^^^ ".toCharArray(),
          "  ^^^^^^      ".toCharArray(),
          "  ^^^^        ".toCharArray()
        };      
        assertEquals(3, Dinglemouse.peakHeight(mountain));
    

    Your solution should handle a map of mountains and deduce the numbers.

  • Custom User Avatar

    We don't know. We would have to see your code to know.