3 ms·
Something very similar was my first programming project in college! The easiest method that most of us did was to brute force it and see if the ends were in the
by syntaxing 3y ago
Something very similar was my first programming project in college! The easiest method that most of us did was to brute force it and see if the ends were in the same location and angled correctly. Apparently there was a O(n) method that uses discrete mathematics but I didn’t really
understand it at the time. It really is a great puzzle to solve.
- UltimateEdge 3y agoSurely following the path of the track (to see if the ends were in the same location and angled correctly, as you describe) is O(n)?
- syntaxing 3y agoProbably should have clarified, the goal of the project was to generate a valid track
- tgv 3y agoNot my first project, but an assignment in the first year. It was about minimizing coin change. I had a solution very different from the others, and the teacher wrote something along the lines of "I suppose that'll work too" on my solution. Can't remember what I came up with, though.
- Akronymus 3y agoCalculate smallest coinage (in terms of value of each coin) amount and progressively replacing them with the next higher amount? 2x1 cent -> 1x 2 cents, 2x2 cents +1x1 cent -> 1x5 cent and so on, maybe?