Project Euler 17 - Number letter counts
Project Euler 17 - Number letter counts
Official link: https://projecteuler.net/problem=17
Thought Process
Thought Process
I created 2 list:
ONES = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"]
TENS = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"]
I then have a function Number_to_english(x) that takes a number and return the word version of the number
Interactive Code
Interactive Code
Input an integer (yourinput)
Code will output the amount of letters used for all numbers up till yourinput