New blog, not much to see.
Will be adding things, and eventually move some old things from https://ysth.livejournal.com.
Will be adding things, and eventually move some old things from https://ysth.livejournal.com.
Task 2: Encrypted String: You are given a string $str and an integer $int. Write a script to encrypt the string using the algorithm — for each character $char in $str, replace $char with the $int th character after $char in the alphabet, wrapping if needed and return the encrypted string.
Task 1: Max Str Value: You are given an array of alphanumeric string, @strings. Write a script to find the max value of alphanumeric string in the given array. The numeric representation of the string, if it comprises of digits only otherwise length of the string. I'm going
Task 2: Binary Prefix: Given an array of 0s and 1s, return Booleans indicating whether each non-empty prefix of the array (shortest to longest) is divisible by 5 when interpreted as a binary number (highest bit first). Excellent, a problem involving arrays and math; what a great opportunity to use
Both this weekʼs tasks are not confined to ASCII, making them more real-world applicable. That brings with it real-world problems. Task 1: Last Word: "There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy." — Hamlet You are given a string. Write a