Home > Reflections | ⏮️ ⏭️
2024-08-14
🧠 Education
Influence
🏋 Coding Practice
Given two strings needle
and haystack
, return the index of the first occurrence of needle
in haystack
, or -1
if needle
is not part of haystack
.
🪞 Reflections
- After reviewing the official solutions, it was a good idea to go with brute force.
- Arguably, I should have reached this conclusion sooner.
- Testing
- During manual testing, I found and fixed several indexing errors
- However, the one blunder stayed: continue where break was intended
- A silly mistake
- one that I recognized not too long after a failed submission
- This feels like a good warm up for my interview later today
- Not too stressful
- Gets me coding and re-familiarizes me with my process
⌨️ My Solution