Leetcode 42 – Trapping Rain Water | Two Pointer

Trapping Rain Water

Problem Description: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1 : Example 2: Constraints: Problem Link :Trapping Rain Water – LeetCode Solution(s): Approach 1: Brute Force Solution Java Code: Explanation: 1.Initialization: 2.Main Loop: 3.Finding Maximum Height to the Left: … Read more

Leetcode 88- Merge Sorted Array | Two Pointer

Merge Sorted Array

Merging sorted arrays is a fundamental problem in computer science. The task is to combine two sorted arrays into one sorted array, maintaining the order. The Merge Sorted Array presents this classic problem with a twist — you are asked to merge the arrays in-place. This means that instead of using extra space, you must … Read more

Leetcode 189 – Rotate Array | 3 Approaches

Leetcode 189 - Rotate Array

Problem Description: Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Constraints: Problem Link : Rotate Array – LeetCode Solution(s): Approach 1: Using temporary array Java Code: Complexity: Approach 2 : In-Place Java Code : Complexity:

Leetcode 27- Remove Element from Array

Leetcode 27- Remove Element

Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The order of the elements may be changed. Then return the number of elements in nums which are not equal to val. Consider the number of elements in nums which are not equal to val be k, to get accepted, you need to do the following things: Custom Judge: The judge will test your … Read more

How to create simple horizontal menu bar using HTML and CSS Only

Horizontal menu bar

Creating a simple horizontal menu bar using only HTML and CSS is a fundamental skill for web developers. A well-structured menu bar enhances the user experience, providing clear navigation for your website visitors. In this guide, we’ll walk you through the process of building a sleek, responsive horizontal navigation bar without the need for JavaScript … Read more

SQL – Foreign Key and its use in Database

Primary Key Constraint

In relational databases, a Foreign Key is a crucial concept that helps establish a connection between two tables. It plays a significant role in ensuring data integrity by enforcing referential constraints between records in different tables. By linking one table’s field to the primary key of another table, foreign keys create relationships that allow for … Read more

SQL – Primary Key and its use in a Database

Primary Key Constraint

In this article you will learn about- What is primary Key?  A primary key can be defined in either a CREATE TABLE statement or an ALTER TABLE statement. Databases use keys to compare, sort, and store records, and to create relationships between records. Choosing the primary key in a database is one of the most … Read more

How to connect to MySQL Database Using PHP

How to Insert Data into MySQL Database using PHP

If you want to build dynamic websites, establishing connection to database is one of the main task. In this article , we will provide you step-by-step guide for How to Connect to MySQL Database Using PHP in two different ways. i).MySQLi extension ii).PDO Method Before connecting to database, first create the database. Create Database connect … Read more

How to Install XAMPP on Windows- Step by step guide

icon 1

To run PHP pages, we need to install a software called a web server. For PHP, Apache is such software. Also, we you need to run dynamic PHP websites, you must install database. XAMPP is a bundle of such software which have Apache server, MYSQL database. About XAMPP: Introduction XAMPP is free-to-use Apache Distribution package. … Read more

Division(/) vs Floor Division(//) Operators in Python

Python

In Python, we have two division operators: / and // The / is called normal Division operator and // is called Floor Division operator. The Division (/) operator returns a fractional number whereas Floor Division(//) operator  rounds off the result to the nearest lower whole number. Example: Output: 6.5 Output: 6 Output: -6.5 Output: -7