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-330.md
Created June 20, 2025 22:19
The Weekly Challenge - 330

The Weekly Challenge - 330

Early Bird Club members ONLY

Task 1: Clear Digits

Submitted by: Mohammad Sajid Anwar

You are given a string containing only lower case English letters and digits.

Write a script to remove all digits by removing the first digit and the closest non-digit character to its left.

@manwar
manwar / pwc-329.md
Last active June 21, 2025 18:54
The Weekly Challenge - 329

The Weekly Challenge - 329

Early Bird Club members ONLY

Task 1: Counter Integers

Submitted by: Mohammad Sajid Anwar

You are given a string containing only lower case English letters and digits.

Write a script to replace every non-digit character with a space and then return all the distinct integers left.

@manwar
manwar / pwc-328.md
Created June 20, 2025 21:28
The Weekly Challenge - 328

The Weekly Challenge - 328

Early Bird Club members ONLY

Task 1: Replace all ?

Submitted by: Mohammad Sajid Anwar

You are given a string containing only lower case English letters and ?.

Write a script to replace all ? in the given string so that the string doesn't contain consecutive repeating characters.

@manwar
manwar / pwc-327.md
Created June 19, 2025 17:45
The Weekly Challenge - 327

The Weekly Challenge - 327

Early Bird Club members ONLY

Task 1: Missing Integers

Submitted by: Mohammad Sajid Anwar

You are given an array of n integers.

Write a script to find all the missing integers in the range 1..n in the given array.

@manwar
manwar / ring-device-network.md
Last active June 19, 2025 08:37
How to reset Ring device network?

Ring Doorbell

  1. Open the front cover of Ring Doorbell
  2. Press the yellow/orange button on the front side
  3. Wait for the white ring to rotate
  4. Open the Ring app on the phone
  5. Select the device and go to device health
  6. Select Network and follow the instruction

Ring Chime

@manwar
manwar / list-vs-array-in-perl.md
Last active June 18, 2025 10:32
List vs Array in Perl

Recently, I came across a blog post titled, Slice of Perl by Dave Cross. It's a must-read for Perl programmers, as it highlights a useful feature that can simplify your life.

Reading it, reminded me of a subtle but important distinction I encountered years ago: the difference between lists and arrays in Perl. I'm sharing my insights here in the hope that others will find then helpful.

Before diving into List Slicing or Array Slicing, it's essential to understand the difference between List and Array in Perl.

When I first started learning Perl (around 1998), I only knew about arrays and assumed every list was an array.

However, lists and arrays while related, are distinct concepts.

@manwar
manwar / pwc-326.md
Created June 11, 2025 23:37
The Weekly Challenge - 326

The Weekly Challenge - 326

Early Bird Club members ONLY

Task 1: Day of the Year

Submitted by: Mohammad Sajid Anwar

You are given a date in the format YYYY-MM-DD.

Write a script to find day number of the year that the given date represent.

@manwar
manwar / pwc-325.md
Last active June 6, 2025 22:00
The Weekly Challenge - 325

The Weekly Challenge - 325

Early Bird Club members ONLY

Task 1: Consecutive One

Submitted by: Mohammad Sajid Anwar

You are given a binary array containing only 0 or/and 1.

Write a script to find out the maximum consecutive 1 in the given array.

@manwar
manwar / pwc-324.md
Last active May 31, 2025 12:04
The Weekly Challenge - 324

The Weekly Challenge - 324

Early Bird Club members ONLY

Task 1: 2D Array

Submitted by: Mohammad Sajid Anwar

You are given an array of integers and two integers $r amd $c.

Write a script to create two dimension array having $r rows and $c columns using the given array.

@manwar
manwar / pwc-323.md
Last active May 27, 2025 10:45
The Weekly Challenge - 323

The Weekly Challenge - 323

Early Bird Club members ONLY

Task 1: Increment Decrement

Submitted by: Mohammad Sajid Anwar

You are given a list of operations.

Write a script to return the final value after performing the given operations in order. The initial value is always 0.