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-364.md
Last active March 6, 2026 10:31
The Weekly Challenge - 364

The Weekly Challenge - 364

Early Bird Club members ONLY

Task 1: Decrypt String

Submitted by: Mohammad Sajid Anwar

You are given a string formed by digits and #.

Write a script to map the given string to English lowercase characters following the given rules.

@manwar
manwar / pwc-363.md
Last active February 24, 2026 05:47
The Weekly Challenge - 363

The Weekly Challenge - 363

Early Bird Club members ONLY

Task 1: String Lie Detector

Submitted by: Mohammad Sajid Anwar

You are given a string.

Write a script that parses a self-referential string and determines whether its claims about itself are true. The string will make statements about its own composition, specifically the number of vowels and consonants it contains.

@manwar
manwar / pwc-362.md
Last active February 19, 2026 16:11
The Weekly Challenge - 362

The Weekly Challenge - 362

Early Bird Club members ONLY

Task 1: Echo Chamber

Submitted by: Mohammad Sajid Anwar

You are given a string containing lowercase letters.

Write a script to transform the string based on the index position of each character (starting from 0). For each character at position i, repeat it i + 1 times.

@manwar
manwar / pwc-361.md
Last active February 10, 2026 13:08
The Weekly Challenge - 361

The Weekly Challenge - 361

Early Bird Club members ONLY

Task 1: Zeckendorf Representation

Submitted by: Mohammad Sajid Anwar

You are given an integer (<= 100).

Write a script to return Zeckendorf Representation of the given integer.

@manwar
manwar / pwc-360.md
Last active February 5, 2026 10:18
The Weekly Challenge - 360

The Weekly Challenge - 360

Early Bird Club members ONLY

Task 1: Text Justifier

Submitted by: Mohammad Sajid Anwar

You are given a string and a width.

Write a script to return the string that centers the text within that width using asterisks * as padding.

@manwar
manwar / gist:1d82226127a5b126d69e242c6fa55c52
Last active January 26, 2026 02:47
The Weekly Challenge - 358
# The Weekly Challenge - 358
##### Early Bird Club members ONLY
## Task 1: Max Str Value
##### **Submitted by:** [Mohammad Sajid Anwar](https://manwar.org)
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.
@manwar
manwar / pwc-357.md
Last active January 14, 2026 15:34
The Weekly Challenge - 357

The Weekly Challenge - 357

Early Bird Club members ONLY

Task 1: Kaprekar Constant

Submitted by: Mohammad Sajid Anwar

Write a function that takes a 4-digit integer and returns how many iterations are required to reach Kaprekar's constant (6174). For more information about Kaprekar's Constant please follow the wikipedia page.

Example 1

@manwar
manwar / update-year.md
Created January 7, 2026 18:30
manwar.org year update
manwar@manwar:~/github/manwar.org/public/stats$ gen-adopted-dist | jq --sort-keys --indent 4 '.' > adopted-distributions.json
manwar@manwar:~/github/manwar.org/public/stats$ gen-personal-dist a d | jq --sort-keys --indent 4 '.' > pd-a-d.json
manwar@manwar:~/github/manwar.org/public/stats$ gen-personal-dist e z | jq --sort-keys --indent 4 '.' > pd-e-z.json

Update year manually in the file:

  • github/manwar.org/public/stats/pull-request-master.json
@manwar
manwar / pwc-356.md
Last active January 10, 2026 22:01
The Weekly Challenge - 356

The Weekly Challenge - 356

Early Bird Club members ONLY

Task 1: Kolakoski Sequence

Submitted by: Mohammad Sajid Anwar

You are given an integer, $int > 3.

Write a script to generate the Kolakoski Sequence of given length $int and return the count of 1 in the generated sequence. Please follow the wikipedia page for more informations.

@manwar
manwar / pwc-355.md
Last active December 23, 2025 14:41
The Weekly Challenge - 355

The Weekly Challenge - 355

Early Bird Club members ONLY

Task 1: Thousand Separator

Submitted by: Mohammad Sajid Anwar

You are given a positive integer, $int.

Write a script to add thausand separator, , and return as string.