[Geeks for Geeks] Shortest Path by Removing K walls

Shortest Path by Removing K walls

Given a 2-D binary matrix of size n*m, where 0 represents an empty space while 1 represents a wall you cannot walk through. You are also given an integer k.
You can walk up, down, left, or right. Given that you can remove up to k walls, return the minimum number of steps to walk from the top left corner (0, 0) to the bottom right corner (n-1, m-1).

Note: If there is no way to walk from the top left corner to the bottom right corner, return -1.

Read more
[Geeks for Geeks] Assignment Problem

Assignment Problem

You are the head of a firm and you have to assign jobs to people. You have N persons working under you and you have N jobs that are to be done by these persons. Each person has to do exactly one job and each job has to be done by exactly one person. Each person has his own capability (in terms of time taken) to do any particular job. Your task is to assign the jobs to the persons in such a way that the total time taken is minimum. A job can be assigned to only one person and a person can do only one job.

Read more
[Geeks for Geeks] Word Ladder II

Word Ladder II

unique words of equal lengths. Find all shortest transformation sequence(s) from startWord to targetWord. You can return them in any order possible.

Keep the following conditions in mind:

  • A word can only consist of lowercase characters.
  • Only one letter can be changed in each transformation.
  • Each transformed word must exist in the wordList including the targetWord.
  • startWord may or may not be part of the wordList.
  • Return an empty list if there is no such transformation sequence.

The first part of this problem can be found here.

Read more
[Geeks for Geeks] Word Ladder I

Word Ladder I

Given two distinct words startWord and targetWord, and a list denoting wordList of unique words of equal lengths. Find the length of the shortest transformation sequence from startWord to targetWord.

Keep the following conditions in mind:

  • A word can only consist of lowercase characters.
  • Only one letter can be changed in each transformation.
  • Each transformed word must exist in the wordList including the targetWord.
  • startWord may or may not be part of the wordList.

The second part of this problem can be found here.

Read more
[AlgoExpert] Inverted BisectionRead more
[AlgoExpert] Glob MatchingRead more
[Geeks for Geeks] Nth Natural Number

Nth Natural Number

Given a positive integer N. You have to find Nth natural number after removing all the numbers containing digit 9.

Read more
[Geeks for Geeks] Generate binary string

Generate binary string

Given a string containing of 0, 1 and ? - a wildcard character, generate all distinct binary strings that can be formed by replacing each wildcard character by either 0 or 1.

Read more
[Geeks for Geeks] Subarrays with given sum

Subarrays with given sum

Given an unsorted array arr[] of N integers and a sum. The task is to count the number of subarrays which add to a given number.

Read more
[Geeks for Geeks] Longest K unique characters substring

Longest K unique characters substring

Given a string you need to print the size of the longest possible substring that has exactly K unique characters. If there is no possible substring then print -1.

Read more