Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    expected: [{:location=>"US", :id=>1, :name=>"Awesome Rubber Bottle", :price=>50.07, :card_name=>"Toni Senger II...ber=>"1234-2121-1221-1211", :transaction_date=>#<Date: 2012-07-29 ((2456138j,0s,0n),+0s,2299161j)>}]
    got: [{:location=>"US", :id=>1, :name=>"Awesome Rubber Bottle", :price=>50.07, :card_name=>"Toni Senger II...ber=>"1234-2121-1221-1211", :transaction_date=>#<Date: 2016-07-24 ((2457594j,0s,0n),+0s,2299161j)>}]

    That is the problem. We get 1 failure while submitting. There is no requirement for order by and I have tried both ASC and DESC, I get a different failure each time. Many of these US/EU sales based DB problems are poorly specified. There are hidden ordering requirements every where.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This is still confusing.

    Order by US then EU just means show the US orders first. The requirement needs to state to show them ordered by ID, US first then EU.

  • Custom User Avatar

    No, even as a native speaker it is quite vague. The wikipedia article helps a little but is still not clear.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Even a stub of tests would be nice.

  • Default User Avatar
  • Default User Avatar

    For clarity in dicussion. The following is the list in, the tree created, and the tree by levels result. Either buildTree needs to be fixed or the expectation that treeByLevels is the inverse of buildTree needs to change.

    testIn = [2, 8, 9, 1, 3, 4, 5] -- becomes the following tree
    testTree = Just (TreeNode (Just (TreeNode (Just (TreeNode Nothing Nothing 9))
                                              (Just (TreeNode Nothing Nothing 1)) 8))
                              (Just (TreeNode (Just (TreeNode Nothing Nothing 4))
                                              (Just (TreeNode Nothing Nothing 5)) 3)) 2)
    -- which, by levels is
    byLevelsResult = [2,8,3,9,1,4,5]
    
  • Default User Avatar

    This makes lots of assumptions about the experience of the coder. The wikipedia link is not sufficient.

  • Default User Avatar

    The supplied test case passes but the submit button never lights up.

    Haskell language.

  • Default User Avatar

    I had a hard time submitting this one due to a rendering/interaction bug. I am using Chrome on OSX. The pop-up note telling me how to submit was covering the "submit" button. The lower right corner would redraw and bounce around as I tried to click. I finally got lucky playing pixel whack-a-mole.

  • Default User Avatar
    import Test.Hspec
    import Digitize
    
    test =
      (digitize 123 == [1,2,3]) &&
      (digitize 1 == [1]) &&
      (digitize 12 == [1,2])
    
    main :: IO ()
    main = hspec $ do
      describe "Test digitize" $ do
        it "123, 1, and 12" $ test `shouldBe` True