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 / 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.

@manwar
manwar / pwc-354.md
Last active December 19, 2025 09:42
The Weekly Challenge - 354

The Weekly Challenge - 354

Early Bird Club members ONLY

Task 1: Min Abs Diff

Submitted by: Mohammad Sajid Anwar

You are given an array of distinct integers.

Write a script to find all pairs of elements with the minimum absolute difference.

@manwar
manwar / pwc-353.md
Last active December 19, 2025 09:43
The Weekly Challenge - 353

The Weekly Challenge - 353

Early Bird Club members ONLY

Task 1: Max Words

Submitted by: Mohammad Sajid Anwar

You are given an array of sentences.

Write a script to return the maximum number of words that appear in a single sentence.

@manwar
manwar / pwc-352.md
Last active December 9, 2025 19:09
The Weekly Challenge - 352

The Weekly Challenge - 352

Early Bird Club members ONLY

Task 1: Match String

Submitted by: Mohammad Sajid Anwar

You are given an array of strings.

Write a script to return all strings that are a substring of another word in the given array in the order they occur.

@manwar
manwar / pwc-351.md
Created December 4, 2025 15:26
The Weekly Challenge - 351

The Weekly Challenge - 351

Early Bird Club members ONLY

Task 1: Special Average

Submitted by: Mohammad Sajid Anwar

You are given an array of integers.

Write a script to return the average excluding the minimum and maximum of the given array.

@manwar
manwar / pwc-350.md
Last active November 27, 2025 00:45
The Weekly Challenge - 350

The Weekly Challenge - 350

Early Bird Club members ONLY

Task 1: Good Substrings

Submitted by: Mohammad Sajid Anwar

You are given a string.

Write a script to return the number of good substrings of length three in the given string.