Weekly Challenge 334 Divertissments
content soon
content soon
Software engineering often involves listening to statements of problems, deriving one or more underlying actual problems, and coming up with solutions that address (partially or completely) those problems (and ideally have other advantages or advance other goals as well).[1] But sometimes the starting point you get is a specification
Task 2: Nice Strings: You are given a string made up of lower and upper case English letters only. Write a script to return the longest substring of the give string which is nice. A string is nice if, for every letter of the alphabet that the string contains, it
Task 1: Counter Integers: You are given a string containing only lower case English letters and digits. Write a script to replace every non-digit character with a space and then return all the distinct integers left. The first part is easy. In Python:[1] new_string = string.translate({ c:'
I switched to a wildcard cert, and while getting the ACME DNS challenge working[1] I saw Let's Encrypt is removing support for OCSP (in favor of CRL URLs and the coming increasing shortening of cert validity). So I removed my OCSP Stapling and switched the certs, and
Task 2: Good String: You are given a string made up of lower and upper case English letters only. Write a script to return the good string of the given string. A string is called good string if it doesn’t have two adjacent same characters, one in upper case
Experimenting with isso comments, we'll see how it goes.
Task 1: Replace all ?: You are given a string containing only lower case English letters and ?. Write a script to replace all ? in the given string so that the string doesn’t contain consecutive repeating characters. This problem reminds me of a logic puzzle, figuring out all the possibilities and
Task 1: Missing Integers: You are given an array of n integers. Write a script to find all the missing integers in the range 1..n in the given array. Just offhand, I can think of several approaches to this problem: * loop over the range and for each number loop
Task 1: Day of the Year: You are given a date in the format YYYY-MM-DD. Write a script to find day number of the year that the given date represent. First of all, what calendar the date is in is not given, nor is a location to allow us to
A quick google search for loop sentinels reveals a lot of pages whose focus is using a sentinel value to determine when to end a loop. IMO this misses the key (if you will excuse the expression) value of loop sentinels: preventing unnecessary code duplication. I'm going to
Task 2: Final Price: You are given an array of item prices. Write a script to find out the final price of each items in the given array. There is a special discount scheme going on. If there’s an item with a lower or equal price later in the