题目:
题解:
func leastBricks(wall [][]int) int {cnt := map[int]int{}for _, widths := range wall {sum := 0for _, width := range widths[:len(widths)-1] {sum += widthcnt[sum]++}}maxCnt := 0for _, c := range cnt {if c > maxCnt {maxCnt = c}}return len(wall) - maxCnt
}