Skip to content

Instantly share code, notes, and snippets.

View manwar's full-sized avatar
✌️
Undercover Contributor

Mohammad Sajid Anwar manwar

✌️
Undercover Contributor
View GitHub Profile
@manwar
manwar / pwc-348.md
Last active November 12, 2025 16:20
The Weekly Challenge - 348

The Weekly Challenge - 348

Early Bird Club members ONLY

Task 1: String Alike

Submitted by: Mohammad Sajid Anwar

You are given a string of even length.

Write a script to find out whether the given string can be split into two halves of equal lengths, each with the same non-zero number of vowels.

@manwar
manwar / pwc-347.md
Created November 3, 2025 10:58
The Weekly Challenge - 347

The Weekly Challenge - 347

Early Bird Club members ONLY

Task 1: Format Date

Submitted by: Mohammad Sajid Anwar

You are given a date in the form: 10th Nov 2025.

Write a script to format the given date in the form: 2025-11-10 using the set below.

@manwar
manwar / pwc-346.md
Last active November 2, 2025 13:41
The Weekly Challenge - 346

The Weekly Challenge - 346

Early Bird Club members ONLY

Task 1: Longest Parenthesis

Submitted by: Mohammad Sajid Anwar

You are given a string containing only ( and ).

Write a script to find the length of the longest valid parenthesis.

@manwar
manwar / pwc-345.md
Last active October 20, 2025 16:10
The Weekly Challenge - 345

The Weekly Challenge - 345

Early Bird Club members ONLY

Task 1: Peak Positions

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Find all the peaks in the array, a peak is an element that is strictly greater than its left and right neighbours. Return the indices of all such peak positions.

@manwar
manwar / pwc-344.md
Last active October 16, 2025 08:41
The Weekly Challenge - 344

The Weekly Challenge - 344

Early Bird Club members ONLY

Task 1: Array Form Compute

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints and an integer, $x.

Write a script to add $x to the integer in the array-form.

@manwar
manwar / pwc-343.md
Last active October 13, 2025 04:58
The Weekly Challenge - 343

The Weekly Challenge - 343

Early Bird Club members ONLY

Task 1: Zero Friend

Submitted by: Mohammad Sajid Anwar

You are given a list of numbers.

Find the number that is closest to zero and return its distance to zero.

@manwar
manwar / pwc-342.md
Last active September 30, 2025 14:22
The Weekly Challenge - 342

The Weekly Challenge - 342

Early Bird Club members ONLY

Task 1: Balance String

Submitted by: Mohammad Sajid Anwar

You are given a string made up of lowercase English letters and digits only.

Write a script to format the give string where no letter is followed by another letter and no digit is followed by another digit. If there are multiple valid rearrangements, always return the lexicographically smallest one. Return empty string if it is impossible to format the string.

@manwar
manwar / pwc-341.md
Created September 23, 2025 00:31
The Weekly Challenge - 341

The Weekly Challenge - 341

Early Bird Club members ONLY

Task 1: Broken Keyboard

Submitted by: Mohammad Sajid Anwar

You are given a string containing English letters only and also you are given broken keys.

Write a script to return the total words in the given sentence can be typed completely.

@manwar
manwar / using-bless.pl
Created September 22, 2025 19:28
Mimic Role in blessed class
use v5.38;
use Test::More;
package Role;
our %REQUIRES;
sub import ($role, @methods) {
my $target = caller;
@manwar
manwar / pwc-340.md
Last active September 16, 2025 10:16
The Weekly Challenge - 340

The Weekly Challenge - 340

Early Bird Club members ONLY

Task 1: Duplicate Removals

Submitted by: Mohammad Sajid Anwar

You are given a string, $str, consisting of lowercase English letters.

Write a script to return the final string after all duplicate removals have been made. Repeat duplicate removals on the given string until we no longer can.