Competitive Programming (Draughts) | CodeChef

This problem was asked in February challenge 2014. Around 900 people were able to solve this problem during challenge duration. It’s a nice problem requiring the knowledge of graphs. It’s not very intuitive for beginners. And also not very straightforward for someone not doing competitive programming. Here’s the problem link: Codechef […]

Custom Sort String – LeetCode Solution [Medium]

Problem statement You are given two strings order and t. All the words of order are unique and were sorted in some custom order previously. Permute the characters of t so that they match the order that order was sorted. More specifically, if a character x occurs before a character y in order, then x should occur before y in the permuted string. Return any permutation of string t that satisfies […]

A Chocolate Fiesta | HackerRank

Welcome to the exciting class of Professor Manasa. In each lecture she used to play some game while teaching a new concept. Today’s topic is Set Theory. For today’s game, she had given a set A = {a1, a2, …aN} of N integers to her students and asked them to play the game as follows. […]

Max Area of Island – LeetCode Solution [Medium]

You are given an m x n binary matrix grid. An island is a group of 1‘s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in grid. If there […]