Solve Subarray Sums Divisible by K: A linear time complexity approach

The Subarray Sums Divisible by K approach is a technique used to solve problems that involve finding the number of subarrays in an array whose sum is divisible by a given number (K). The approach uses the concept of “prefix sums” and “modulo operation” to efficiently find the number of such subarrays in linear time […]

Solve Subarray Sums Divisible by K: A linear time complexity approach Read More »

Maximum Sum Circular Subarray Leet Code with C++, Python, Java, and JavaScript Solutions

leetcode question solution

Example 1: Input: [3,-2,2,-3] Output: 3 Explanation: Subarray [3] and [3,-2,2] both have the maximum sum 3 Example 2: Input: [-2,-3,-1] Output: -1 Explanation: Subarray [-1] has the maximum sum -1 Solution Explanation: We iterate through the array and keep track of the maximum sum subarray seen so far, the maximum sum subarray ending at

Maximum Sum Circular Subarray Leet Code with C++, Python, Java, and JavaScript Solutions Read More »

C++ Input and Output: Understanding cin, cout, cerr and clog with Examples

In C++, input and output (I/O) operations are performed using the standard input/output library, which is defined in the <iostream> header file. The basic I/O operations in C++ are performed using the following four standard streams: Here’s an example of a simple program that uses cin and cout to read an integer from the keyboard

C++ Input and Output: Understanding cin, cout, cerr and clog with Examples Read More »

Find the Longest Substring Without Repeating Characters: Solution and Algorithm

leetcode question solution

The problem of finding the longest substring without repeating characters is a common problem in computer science and can be found in various coding interviews and competitions. The task is to find the longest substring in a given string that does not contain any repeating characters. For example, given the string “abcabcbb”, the longest substring

Find the Longest Substring Without Repeating Characters: Solution and Algorithm Read More »

Amortised Time complexity , and there method to find

What is amortised time complexity and method to calculate? Amortized time complexity is a measure of the efficiency of an algorithm that takes into account the average time taken by the algorithm over a sequence of operations, rather than just the worst-case or best-case time complexity. One method for calculating the amortized time complexity of

Amortised Time complexity , and there method to find Read More »

Binary Trees – Data structure – Nilesh blog.tech

What are Binary Trees? A binary tree is a tree data structure in which each node has at most two children. The children are referred to as the left child and the right child.Binary trees are commonly used to implement binary search trees and binary heaps. They have several useful properties, such as the ability

Binary Trees – Data structure – Nilesh blog.tech Read More »

Leet Code 55. Tackling Jump I , II , III , IV Game | Cpp ,Java ,Python – Day 3

leetcode question solution

Leet Code 55.:In this post, we’ll look at two jump game difficulties offered on Leet Code 55. These are well-known coding tasks that might be difficult to complete in a single attempt.We’ll go over numerous approaches to solving both issues step by step using complexity analysis. So, let’s begin with the first. Day 3 Coding

Leet Code 55. Tackling Jump I , II , III , IV Game | Cpp ,Java ,Python – Day 3 Read More »