Ad
  • Default User Avatar

    laundry list of annoyances while solving:

    • remove last note about empty insertions resulting in no change, that's redundant
    • say that the array is sorted when introducing the array instead of adding on a "note" later.
    • add test cases with repeated duplicate indices, or motivate why that doesn't happen
    • remove trailing spaces in solution stub
    • fix the age-old issue with the invalid fixed test
  • Custom User Avatar

    The result of most solutions can be read multiple times through __iter__ and __next__ methods used in for loops.

    Perhaps there should be tests for that?

  • Default User Avatar

    I am having the same problem as jgarwin95. My code does what it says in the description. After defining a = [1, 2, 3, 4], calling a[0] returns 1 and calling it again returns 2 (since a[0] is deleted after the first calling). However, I get an error saying '1 should equal 2' for the first case, and '2 should equal 4' in the second case. Any ideas on why this might be the case? If you need to see my code, let me know and I can copy and paste it.

    And just to see what happens, I redefined my code so that when a[index] is called, it returns (and pops) a[index+1], i.e the output would be 2 in the first case. However, now the test case gave an error saying '2 should equal 1' !!!!

  • Custom User Avatar
  • Custom User Avatar
    • Node 12 should be enabled (Refer this and this for more info)
  • Custom User Avatar

    I made a simple little function to log the map out to it's clear to see what's going on. Might be a nice feature to add in the preload section.

    function log(map) {
      console.log("<pre>" + map.map(collapseLine).join("\n") + "</pre>");
    }