Ad
  • Custom User Avatar

    thanks a lot

  • Custom User Avatar

    Hi there.

    sumIntervals( [
    [1, 5],
    [10, 20],
    [1, 6],
    [16, 19],
    [5, 11]
    ] ) => 19

    could you help me?
    I dont understand how to parse it, what are arrays overlapping.

  • Custom User Avatar

    Hi there.

    I dont understand

      Expect(SumOfIntervals([][2]int{{1, 5}, {1, 5}})).To(Equal(4))
      Expect(SumOfIntervals([][2]int{{1, 4}, {7, 10}, {3, 5}})).To(Equal(7))
      Expect(SumOfIntervals([][2]int{{0, 20}, {-100_000_000, 10}, {30, 40}})).To(Equal(100_000_030))
    

    1 test has to equal 8

    2 test has to equal 8

    3 test has to equal 100_000_040. For example {-4, 1}: 1 - (- 4) = 5 :> -4, -3, -2, -1, 0, interval is 5,

    What do i do wrong?
    Golang

  • Custom User Avatar

    it is cheat =)
    good job

  • Custom User Avatar

    thank you a lot.
    I ve done this kata

  • Custom User Avatar

    Hello.

    My program has done tests which was wrong

    For example wrong test:
    Exptected:
    {6, 9, 11}
    Equal:
    {0, 6, 9, 11}

    My test has done:
    Expect(ArrayDiff([]int{6, 9, 7, 0, 11}, []int{-2, 7, 18, -1, 16, -19, 3, -18, -5})).To(Equal([]int{6, 9, 11})), passed

    Expect(ArrayDiff([]int{-18, 9, 13, 1, 6, 13, -5, 17, -4, -10, -10, -1, 3, 12, -4, 10, 0, -15}, {3, 19})).To(Equal([]int{6, 9, 11})), passed

    Why?

  • Custom User Avatar

    its amazing, thank you!

  • Custom User Avatar

    This is cheat! 👍😉

  • Custom User Avatar

    Pretty nice, thanks for yours solution