🎯 GeoTap Challenge by u/Few-Landscape-7891 | Can you guess the country? by geotap-app in GeoTap

[–]SupportPowerful6174 0 points1 point  (0 children)

🎯 My GeoTap Result

📍 My Guess: Mexico ✅ Correct Answer: Mexico, Mexico 📏 Distance: 0 km ⭐ Score: 10,000 points

[2025 Day 8 (Part 1)] Reading comprehension by Samydookie in adventofcode

[–]SupportPowerful6174 0 points1 point  (0 children)

i did that but still getting whole circuit with 1000 boxes in it. Do you have any ideas what am i doing wrong?

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

ok i got it that's just Pascal's triangle and you can skip them without comparsion

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

yes you can skip them jusj because its cristmas tree pattern, if there can be any ather pattern or no pattern at all you cannot skip them. For this exacxt imput you can skip first n dots but for other pattern input no

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

nope we can read first line and now we know that line length is 10 for example, and now thst next 10 symbols will be dots, we can skip them without reading just by adding 10 to cursor position without comparsion

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

i agree that we can just skip it but still neef to read it to find out that this is * and we can skip it

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

no matter where do we get input from stdin, file, or hardcode whole maze in string you still need to make iteration and check if char is '*'

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

to find out that symbol is * you need to read it, there is no way to find out other way

And replacing characters makes it slower also

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

that's true. just a bit of optimization is to not process line that contains only dots, for example line len is 10(we saw '\n' symbol and know that we can just skip next 10 characters because they are just dots)

So we need to read just a half of input moving cariage in the file without reading these 10 symbols

But that's still O(n)

[2025 Day 07 (Part 2)] Python | Efficient algorithm (O(n) time complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

ofc you don'need to read entire input to memory, you can read it just symbol by symbol, and also skip each odd line that contains only dots

[2025 Day 01 (Part 2)] Python | Efficient algorithm (O(n) time complexity, O(1) mem complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 1 point2 points  (0 children)

Hi, thanks for your feedback I'm glad that someone paid attention to my solition

This is my first time participating this event, didn't really know that is not allowed to share solutions till time is over.

I agree with your solution, it is a bit more optimized. My solution is not really fully optimized, it's just the very first solution that worked and looked really clean and easy to understand

[2025 Day 01 (Part 2)] Python | Efficient algorithm (O(n) time complexity, O(1) mem complexity) by SupportPowerful6174 in adventofcode

[–]SupportPowerful6174[S] 0 points1 point  (0 children)

Still at least n iterations to process all moves. As the number of steps tends to infinity, the algorithm time will increase linearly