You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: 2024/README.md
+34
Original file line number
Diff line number
Diff line change
@@ -204,3 +204,37 @@ Nice and interesting puzzle today
204
204
Basically a simple path finding but with a few twists that make it fun
205
205
206
206
Will try to optimize solution
207
+
208
+
Edit: Haven't found any easy optimization
209
+
210
+
I know a way to optimize : Have another Map containing this time the set of valid spots => if already been on a position no need to do it again even from another good path.
211
+
212
+
For example
213
+
```
214
+
#######
215
+
#....E#
216
+
#.#.###
217
+
#S..###
218
+
#######
219
+
```
220
+
221
+
The first path explored will be this one
222
+
```
223
+
#######
224
+
#..OOE#
225
+
#.#O###
226
+
#SOO###
227
+
#######
228
+
```
229
+
230
+
But then at the moment when I reach the last intersection I need to go back up to the end
231
+
232
+
```
233
+
#######
234
+
#OOXXE#
235
+
#O#.###
236
+
#S..###
237
+
#######
238
+
```
239
+
240
+
The optimization would allow me to skip this last part represented with `X`
0 commit comments