×
Write a function to find the longest common prefix string amongst an array of strings.

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: strs =

Roman to Integer

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral,

Integer to Roman

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral,

Regular Expression Matching

Given an input string s and a pattern p, implement regular expression matching with support for ‘.’ and ‘*’ where: ‘.’ Matches any single character.​​​​ ‘*’ Matches zero or more of the preceding element. The matching should cover the entire input

Palindrome Number without converting the integer to a string

Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not. Example 1: Input: x = 121 Output:

Reverse Integer

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 – 1], then return 0. Assume the environment does not

Zigzag Conversion

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P

Longest Palindromic Substring

Given a string s, return the longest palindromic substring in s. Example 1: Input: s = “babad” Output: “bab” Explanation: “aba” is also a valid answer. Example 2: Input: s = “cbbd” Output: “bb”

Given a string s, find the length of the longest substring without repeating characters.

Example 1: Input: s = “abcabcbb” Output: 3 Explanation: The answer is “abc”, with the length of 3. Example 2: Input: s = “bbbbb” Output: 1 Explanation: The answer is

Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.

The overall run time complexity should be O(log (m+n)). Example 1: Input: nums1 = [1,3], nums2 = [2] Output: 2.00000 Explanation: merged array = [1,2,3] and median is 2. Example 2:

Leetcode: Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.

Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if

LeetCode : Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may

Nested Lists in Python

Nested lists are Python representations of two dimensional arrays. They are used to represent lists of lists. For example, a list of grocery lists for the month or matrices we can

Slicing Python Strings

Python comes with a string slicing system, Slicing is nothing but fetching a piece from a pie. Square Bracket [] notation allows us to slice Python strings to get one

Send & Read E-Mail in Python

Generally, to send emails we use an SMTP server and to view emails we use IMAP servers. Python Provides In-built Modules to Send and Read emails, to send emails we

Requests Library in Python

Requests Library is used to make requests to the HTTP websites/API endpoints. Using requests library we can make a request to a URL, get information of a website such as

Abstraction and Encapsulation in OOPS – Python

Table of Contents Show / Hide 1. Abstraction in Python2. abstract method3. abstract class4. Important conclusions about abstract class and abstract method4.1. Interface Classes5. Encapsulation in Python6. Public Members7. Private

Indentation in Python

An indent in python is where the block of code belonging to a clause starts. An indent provides space or tab which also provides an increase in readability. All the

Operator Overloading in Python

Operator Overloading is making an operator perform some action other than an existing option. Python does support Operator Overloading. The main usage of Operator Overloading in Python is we can

Polymorphism in OOPS – Python

Polymorphism means the ability to represent an object in many forms using a single interface. Polymorphism is derived from two different words poly which means many, morphs means many forms.

Inheritance in OOPS – Python

Inheritance is an important concept in object-oriented programming. Inheritance means deriving a new class from an existing class. A class that inherits the properties is known as child class and

Classes and Constructors OOPS Concept – Python

OOP’s Concept is a programming concept that uses objects and classes in programming. OOP’s is all about objects and everything we create/write is an object. Objects provide a better and

File Handling in Python

Python provides file handling and supports users to read, write and perform many other operations on files. Python has an in-built function that can open a file and perform manipulations

Box Plot with Plotly

A box plot is a demographic representation of numerical data through their quartiles(data points divided into quarters). The end and upper quartiles are represented in a box,  while the median (second quartile)

Plotly Express Data Pacakges

Plotly Express provides various data packages(i.e built-in datasets) for demonstration, educational and test purposes. We can use these packages to create various plots with any of the Plotly submodules –

Introduction to Kivy

Kivy is an open-source software library for the rapid development of applications equipped with novel user interfaces, such as multi-touch apps. Creating Kivy apps is fun and rewarding. You will

Gantt Chart with Plotly

A Gantt chart is a type of bar chart that illustrates a project schedule. This chart lists the tasks to be performed on the vertical axis, and time intervals on

Area Charts with Plotly

An area chart is a form of a line chart with the area between the horizontal axis and the line that connects data points filled with colour. They are used

Functions in Python

Functions are a group of statements that can be executed when we call them. We need to define these statements inside a single block such that whenever there is a

Creating Tables with Plotly

A table helps in organizing the data into columns and rows. The use of tables is prevalent throughout all communication, research, and data analysis. Tables privilege rapid entrance and proportionately