Substrings, time complexity and total number of substringsString (n) — n*(n+1)/2 Time Complexity — O(n2) Space Complexity — O(n2) — All the substring combined.Apr 30, 2024Apr 30, 2024
Longest Ideal SubsequenceYou are given a string s consisting of lowercase letters and an integer k. We call a string t ideal if the following conditions are…Apr 26, 2024Apr 26, 2024
Valid Parenthesis StringGiven a string s containing only three types of characters: ‘(‘, ‘)’ and ‘*’, return true if s is valid.Apr 7, 2024Apr 7, 2024
Minimum Remove to Make Valid ParenthesesGiven a string s of ‘(‘, ‘)’ and lowercase English characters.Apr 7, 2024Apr 7, 2024
Subarrays with K Different IntegersGiven an integer array nums and an integer k, return the number of good subarrays of nums.Mar 30, 2024Mar 30, 2024
Reverse Linked ListGiven the head of a singly linked list, reverse the list, and return the reversed list.Mar 21, 2024Mar 21, 2024
Middle of the Linked ListGiven the head of a singly linked list, return the middle node of the linked list.Mar 7, 2024Mar 7, 2024
Find the Town JudgeIn a town, there are n people labeled from 1 to n. There is a rumor that one of these people is secretly the town judge.Feb 25, 2024Feb 25, 2024
Bitwise AND of Numbers RangeGiven two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive.Feb 21, 2024Feb 21, 2024