Aditya Chatterjee's Blog, page 85

June 7, 2022

Longest word in dictionary with all prefixes

Problem Statement

Given a list of words ‘WORDLIST’, find the longest perfect word. A perfect word is a word in which all the possible prefixes are present in ‘WORDLIST’.

If more than one perfect word of the same length is present in the ‘WORDLIST’, return the word with the smallest lexicographical order. You can return an empty string if no such word is possible for the given input.

Input

["w", "wo", "wor", "wow", "worm", "work"]
["w","wo","wor","worl","world"]
["a","banana","app","appl","ap","...

 •  0 comments  •  flag
Share on Twitter
Published on June 07, 2022 09:30

June 6, 2022

Detect if feature is supported in Browser using HTML

Table of contentsDetecting feature support in JavascriptDetecting CSS support using @supportsUsing Modernizr to detect feature support

Sometimes you want to support a large variety of browsers, while still being able to use features provided by newer browsers. Other times, different browsers might provide different ways of doing the same thing. In both these cases, you’ll need to detect which features are supported by some browser and adapt accordingly. By checking whether a feature is supp...

 •  0 comments  •  flag
Share on Twitter
Published on June 06, 2022 06:15

June 5, 2022

Solve Crossword using Backtracking

In this article, we have covered the Backtracking Algorithm for Crossword and compared with the Brute Force approach. We have presented the Time and Space Complexity for various cases.

Table of contents:

IntroductionNaive ApproachBacktrackingTime and Space ComplexityConclusionIntroduction

A crossword is a word puzzle that usually consists of a square or rectangular grid of white and black-shaded squares. By solving clues that lead to the solutions, the goal is to fill the white squares wi...

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2022 14:38

SpineNet

In this article, we introduce SpineNet as an image recognition deep learning Convolutional Neural Network (CNN). As a background, it is recommended that if you are not familiar with CNN, you should read this article first.

CNN is a relatively advanced machine learning (ML) topic but this blog post contains a bit-size introduction to different basic key operations of CNN and Artificial Neural Network (ANN) that is used for deep learning in the field of image recognition.

SpineNet proposes an alte...

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2022 14:22

RefineDet model

RefineDet model is a popular Deep Learning model that is used for Object Detection applications as an alternative to SSD and YOLO based CNN models.

Table of contents:

Introduction to Deep Learning ApplicationsRefineDet modelDifferent Object Detection modelsIntroduction to Deep Learning Applications

Computer Vision
Computer vision is a branch of artificial intelligence (AI) that allows computers and systems to extract useful information from digital photos, videos, and other visual inputs, a...

 •  0 comments  •  flag
Share on Twitter
Published on June 05, 2022 14:16

June 4, 2022

Flattened Convolutional Neural Network

In this article, we have explored the idea of Flattened Convolutional Neural Network and the problem of conventional CNN it solves.

Table of contents:

Introduction to Convolutional Neural NetworksProblems with Conventional Convolutional Neural NetworksA Solution (Flattened Convolutional Neural Networks)Training Flattened Convolutional ModelsBenefitsSummaryIntroduction to Convolutional Neural Networks

Convolutional Neural Networks (CNNs) are a class of Artificial Neural Networks that are ...

 •  0 comments  •  flag
Share on Twitter
Published on June 04, 2022 07:07

Different ways to add and remove rows in Pandas Dataframe

To introduce the topic, we will be talking about Pandas Dataframe and how easily we can add and remove rows in a DataFrame by following simple steps.

Table of contents:

Adding a Row using a DictionaryAdding a Row using a ListAdding a Row using a SeriesRemoving a Row by NameRemoving a Row by PositionRemoving a Row by the boolean indexAdding a Row using a Dictionary

Let's say that we have a Pandas DataFrame named as df which looks like

firstlastemailLenaRobertlena@gmailAshle...
 •  0 comments  •  flag
Share on Twitter
Published on June 04, 2022 05:18

June 3, 2022

Algorithm to check win in tic-tac-toe

In this article, we have presented an algorithm to check win and loss for a given Tic Tac Toe configuration.

NOTE: this algorithm assumes that the game data is passed in the following format

data = [ # the lists are rows while the individual dictionaries are tiles (the move made and the tile number) [ {'move': 'x', 'number': 1}, {'move': 'o', 'number': 2}, {'move': 'x', 'number': 3} ], [ {'move': 'x', 'number': 4}, {'move': 'o', 'number': 5...
 •  0 comments  •  flag
Share on Twitter
Published on June 03, 2022 13:24

map::begin and map::end in C++

In this article, we have covered the concept of map::begin and map::end in C++ STL along with C++ code examples.

Table of contents

Following, is the list of contents that would be discussed in this article

Introduction to mapsUses of a mapAccessing elements of a mapUsing the begin() function in a mapUsing the end() function in a mapIntroduction to maps

Maps are special data-structure in c++, that store data in the form of a key value pairs. They are termed as a map since each key in this ...

 •  0 comments  •  flag
Share on Twitter
Published on June 03, 2022 11:48

Rounded corners/ Border radius in CSS

The border-radius property in CSS allows you to round the corners of the outer edge of an element. Through this property, it is possible to round all the corners or just selected corners according to the desired shape.

CSS Syntax:border-radius: 1-4 length|% / 1-4 length|%|initial|inherit;

The syntax suggests that the border-radius property can either take specific measurements as input or the measurement could be inherited from the parent element. Initial is used to set the value to default.

T...

 •  0 comments  •  flag
Share on Twitter
Published on June 03, 2022 11:35