mykoza

@mykoza@lemmy.world

This profile is from a federated server and may be incomplete. Browse more on the original instance.

mykoza,

I’m struggling to fully understand your solution. Could you tell me, why do you return 1 when at the end of a and b ? And why do you start from size + 1?

mykoza,

Thanks for the detailed explanation. It helped a lot, especially what the tbl actually holds.

I’ve read your code again and I get how it works, but it still feels kinda strange that we are considering values outside of range of a and b, and that we are marking them as correct. Like in first row of the example ???.### 1,1,3, there is no spring at 8 and no group at 3 but we are marking (8,3) and (7,3) as correct. In my mind, first position that should be marked as correct is 4,2, because that’s where group of 3 can fit.

mykoza,

You are probably right. Just my rumblings. Thanks for the help.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • InstantRegret
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • DreamBathrooms
  • JUstTest
  • Durango
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • lostlight
  • All magazines