The Weekly Challenge 287, Task 1| blogs.perl.org
I’m sorry for the lack of music this time around, but when I read “broken keys”, there’s only one broken key I can think of.| Packy’s Place
Musical free association: “B after A” became “time to play B sides…“| Packy’s Place
The Weekly Challenge 270/2| blogs.perl.org
The Weekly Challenge 145 The Task 2 of the Weekly Challenge #145 asked us to build a Palindromic Tree. It also linked to a blog post explaining the "Eertree" data structure. Maybe it was just me, but I found...| E. Choroba
Product SubArray Given a list of 4 or more numbers, write a script to find the contiguous sublist that has the maximum product. The length of the sublist is irrelevant; your job is to maximize the product. Example Input:...| E. Choroba
Excel Column Write a script that accepts a number and returns the Excel Column Name it represents and vice-versa. Excel columns start at A and increase lexicographically using the 26 letters of the English alphabet, A..Z. After Z, the...| E. Choroba
Linked List You are given a linked list and a value k. Write a script to partition the linked list such that all nodes less than k come before nodes greater than or equal to k. Make sure you...| E. Choroba
Compare Version Compare two given version number strings v1 and v2 such that: If v1 > v2 return 1 If v1 < v2 return -1 Otherwise, return 0 The version numbers are non-empty strings containing only digits, and the...| E. Choroba
Shortest Unique Prefix Write a script to find the shortest unique prefix for each each word in the given list. The prefixes will not necessarily be of the same length. Sample Input [ "alphabet", "book", "carpet", "cadmium", "cadeau", "alpine"...| E. Choroba
Diff-K You are given an array @N of positive integers (sorted) and another non negative integer $k. Write a script to find if there exists 2 indices $i and $j such that $A[$i] - $A[$j] == $k and $i...| E. Choroba
Kth Permutation Sequence Write a script to accept two integers n (>=1) and k (>=1). It should print the k-th permutation of n integers. For example, n=3 and k=4, the possible permutation sequences are listed below: 123 132 213...| E. Choroba
Rotate Matrix Write a script to rotate the following matrix by given 90/180/270 degrees clockwise. [ 1, 2, 3 ] [ 4, 5, 6 ] [ 7, 8, 9 ] For example, if you rotate by 90 degrees then...| E. Choroba
Stepping Numbers Write a script to accept two numbers between 100 and 999. It should then print all Stepping Numbers between them. A number is called a stepping number if the adjacent digits have a difference of 1. For...| E. Choroba