Split Linked List Alternatingly
Given a singly linked list’s head. Your task is to complete the function alternatingSplitList() that splits the given linked list into two smaller lists. […]
Given a singly linked list’s head. Your task is to complete the function alternatingSplitList() that splits the given linked list into two smaller lists. […]
A string s is called happy if it satisfies the following conditions: s only contains the letters ‘a’, ‘b’, and ‘c’. s does not contain any of “aaa”, “bbb”, or “ccc” as a
There are n balls on a table, each ball has a color black or white. You are given a 0-indexed binary string s of length n, where 1 and 0 represent
Given an unsorted array of integers arr[], and a target tar, determine the number of subarrays whose elements sum up to the
You are given a 0-indexed integer array nums and an integer k. You have a starting score of 0. In one operation: choose an index i such that 0 <= i <
Given a singly linked list. The task is to find the length of the linked list, where length is defined
You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists. We define
Given a Singly Linked List, Delete all alternate nodes of the list ie delete all the nodes present in even positions. Examples
You are given a 2D integer array intervals where intervals[i] = [lefti, righti] represents the inclusive interval [lefti, righti]. You have to divide the intervals into one
Given an array of integers arr, the task is to find and return the maximum sum of the smallest and second smallest element among all possible subarrays
There is a party where n friends numbered from 0 to n – 1 are attending. There is an infinite number of chairs in this party that are