PROBLEM DESCRIPTION Given an array of integers nums and a number k, write a function that returns true if given array can be divided into pairs such that sum of every pair is divisible by k. geek...
Longest consecutive subsequence (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given an array of non-negative integers. Find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can...
Convert a sentence into its equivalent mobile numeric keypad sequence (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a sentence in the form of a string in uppercase, convert it into its equivalent mobile numeric keypad sequence. Please note there might be spaces in between the words in ...
Find first repeated character (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string S. The task is to find the first repeated character in it. We need to find the character that occurs more than once and whose index of second occurrence is small...
Minimum indexed character (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string str and another string patt. Find the minimum index of the character in str that is also present in patt. geeksforgeeks SOLUTION class Solution { //Functi...
Count distinct elements in every window (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given an array of integers and a number K. Find the count of distinct elements in every window of size K in the array. geeksforgeeks SOLUTION class Solution { ArrayList...
Remove Duplicates (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given a string str without spaces, the task is to remove all duplicate characters from it, keeping only the first occurrence. Note: The original order of characters must be ke...
Uncommon characters (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given two strings A and B consisting of lowercase english characters. Find the characters that are not common in the two strings. Note :- Return the string in sorted order. g...
Merge Without Extra Space (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order. Merge them in sorted order without using any extra space. Modify arr1 so that it contains th...
Number of pairs (geeksforgeeks - SDE Sheet)
PROBLEM DESCRIPTION Given two positive integer arrays arr and brr, find the number of pairs such that xy > yx (raised to power of) where x is an element from arr and y is an element from brr. ...