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-270.md
Last active May 18, 2024 14:17
The Weekly Challenge - 270

The Weekly Challenge - 270

Early Bird Club members ONLY

Task 1: Special Positions

Submitted by: Mohammad Sajid Anwar

You are given a m x n binary matrix.

Write a script to return the number of special positions in the given binary matrix.

@manwar
manwar / pwc-269.md
Last active May 12, 2024 23:21
The Weekly Challenge - 269

The Weekly Challenge - 269

Early Bird Club members ONLY

Task 1: Bitwise OR

Submitted by: Mohammad Sajid Anwar

You are given an array of positive integers, @ints.

Write a script to find out if it is possible to select two or more elements of the given array such that the bitwise OR of the selected elements has atlest one trailing zero in its binary representation.

@manwar
manwar / pwc-268.md
Last active May 3, 2024 10:56
The Weekly Challenge - 268

The Weekly Challenge - 268

Early Bird Club members ONLY

Task 1: Magic Number

Submitted by: Mohammad Sajid Anwar

You are given two arrays of integers of same size, @x amd @y.

Write a script to find the magic number that when added to each elements of one of the array gives the second array. Elements order is not important.

@manwar
manwar / swagger-oas.md
Last active May 2, 2024 10:57
Swagger OpenAPI Specification (OAS)
@manwar
manwar / pwc-267.md
Last active April 27, 2024 18:17
The Weekly Challenge - 267

The Weekly Challenge - 267

Early Bird Club members ONLY

Task 1: Product Sign

Submitted by: Mohammad Sajid Anwar

You are given an array of @ints.

Write a script to find the sign of product of all integers in the given array. The sign is 1 if the product is positive, -1 if the product is negative and 0 if product is zero.

@manwar
manwar / pwc-266.md
Last active April 18, 2024 08:12
The Weekly Challenge - 266

The Weekly Challenge - 266

Early Bird Club members ONLY

Task 1: Uncommon Words

Submitted by: Mohammad Sajid Anwar

You are given two sentences, $line1 and $line2.

Write a script to find all uncommmon words in any order in the given two sentences. Return ('') if none found.

@manwar
manwar / pwc-265.md
Last active April 12, 2024 08:42
The Weekly Challenge - 265

The Weekly Challenge - 265

Early Bird Club members ONLY

Task 1: 33% Appearance

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Write a script to find an integer in the given array that appeared 33% or more. If more than one found, return the smallest. If none found then return undef.

@manwar
manwar / pwc-264.md
Last active April 5, 2024 09:42
The Weekly Challenge - 264

The Weekly Challenge - 264

Early Bird Club members ONLY

Task 1: Greatest English Letter

Submitted by: Mohammad Sajid Anwar

You are given a string, $str, made up of only alphabetic characters [a..zA..Z].

Write a script to return the greatest english letter in the given string.

@manwar
manwar / pwc-263.md
Last active March 27, 2024 11:19
The Weekly Challenge - 263

The Weekly Challenge - 263

Early Bird Club members ONLY

Task 1: Target Index

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints and a target element $k.

Write a script to return the list of indices in the sorted array where the element is same as the given target element.

@manwar
manwar / restart-network-manager.txt
Created March 23, 2024 09:30
Restart network in Ubuntu
To restart the network manager in Ubuntu, first check the current status
$ nmcli general status
Now restart the network manager
$ sudo systemtl restart NetworkManager
Check the status again