My Solution in Ruby:
This problem was a lot easier to tackle once I’ve sketched out the formula for calculating each hourglass. That’s why I bought a notebook to derive future algorithms!
Also downloaded git and cleaned up my github today! A few commands to remember when adding files and committing changes:
- Stage the file: git add .filename
- stage a folder with files: git add folder/subfolder/*
- Commit: git commit -m “enter notes/messages about the changes“
- Push to master branch: git push origin master
- Push to another branch: git push origin BRANCH_NAME