Longest Subsequence Problem

Leetcode Problem 1143 Given two strings text1 and text2, return the length of their longest common subsequence. It is known as longest subsequence problem. A subsequence of a string is a new string generated from…

List View in Android

List View is very important to view in the android studio. It is a subclass of AbsListView. Complete Hierarchy of ListView is given java.lang.Object    ↳ android.view.View      ↳ android.view.ViewGroup        ↳ android.widget.AdapterView<android.widget.ListAdapter>    …

Greedy Algorithm with Examples

As the name suggests, this algorithm uses a greedy approach to tackle a problem. What do you mean by a greedy approach or a greedy algorithm? Let’s take us a real-life example, Let assume, you…

Tree in Data Structure

We are already aware of data structures like an array, linked list, stack, queue, etc. But can you guess what is common between all the above data structures ..and why we introduce tree in data…

Find Pivot Index prefix sum problem

Leetcode Problem: Find Pivot Index In our previous post, we solve one problem with prefix sum and now in this, we are again going to solve a problem. Given an array of integers nums, write…

Prefix Sum problem

Problem Statement Given an array of integers and an integer k. Find the total number of continuous subarrays whose sum equals k. Solve this problem using a prefix sum.Example 1:Input:nums = [1,1,1], k = 2Output:…

Prefix Sum in Array

In Previous post we already discuss about sliding window technique and problem, in this post we are going to know about prefix sum technique in array Let us Consider an example, we are given an…

What is Service in Android?

Service is nothing but a ghost that exist but we can not see. In relation to Android, service is an application component that can perform long-running operations without having a user interface. Not going to…