Perl Weekly Challenge 100: Fun Time

You are given a time (12 hour / 24 hour). Write a script to convert the given time from 12 hour format to 24 hour format and vice versa. Ideally we expect a one-liner.

Perl Weekly Challenge 100: Triangle Sum

You are given triangle array. Write a script to find the minimum path sum from top to bottom. When you are on index `i` on the current row then you may move to either index `i` or index `i + 1` on the next row.

Perl Weekly Challenge 97: Binary Substrings

You are given a binary string $B and an integer $S. Write a script to split the binary string $B of size $S and then find the minimum number of flips required to make it all the same.

Perl Weekly Challenge 97: Ceasar Cipher

You are given string $S containing alphabets A..Z only and a number $N. Write a script to encrypt the given string $S using Caesar Cipher with left shift of size $N.

Perl Weekly Challenge 96: Edit Distance

You are given two strings $S1 and $S2. Write a script to find out the minimum operations required to convert $S1 into $S2. The operations can be insert, remove or replace a character. Please check out [the] Wikipedia page for more information.

Perl Weekly Challenge 96: Reverse Words

You are given a string $S. Write a script to reverse the order of words in the given string. The string may contain leading/trailing spaces. The string may have more than one space between words in the string. Print the result without leading/trailing spaces and there should be only one space between words.

Perl Weekly Challenge 95, Part 2

Write a script to demonstrate Stack operations like below: push($n) – add $n to the stack pop() – remove the top element top() – get the top element min() – return the minimum element

Perl Weekly Challenge 95, Part 1

You are given a number $N. Write a script to figure out if the given number is a palindrome. Print 1 if true otherwise 0.

Perl Weekly Challenge 92, Part 2

You are given a set of sorted non-overlapping intervals and a new interval. ($N) Write a script to merge the new interval to the given set of intervals.


Something went wrong. Please refresh the page and/or try again.

Follow My Blog

Get new content delivered directly to your inbox.